Java Code Examples for com.actionbarsherlock.view.SubMenu#getItem()

The following examples show how to use com.actionbarsherlock.view.SubMenu#getItem() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfileEdit.java    From Favorite-Android-Client with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	super.onCreateOptionsMenu(menu);
	MenuItem item;

	SubMenu subMenu1 = menu.addSubMenu(getString(R.string.permission));
	subMenu1.add(0, 1001, 0, getString(R.string.privacy_content));
	subMenu1.add(0, 1002, 0, getString(R.string.write_permission));

	MenuItem subMenu1Item = subMenu1.getItem();
	subMenu1Item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
	
if(!Global.getSetting("user_srl", "0").matches(member_srl))	menu.add(0, 1, 0, getString(R.string.delete))
	.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

	// item = menu.add(0, 1, 0, R.string.Main_MenuAddBookmark);
	// item.setIcon(R.drawable.ic_menu_add_bookmark);

	return true;
}
 
Example 2
Source File: document_write.java    From Favorite-Android-Client with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {

	MenuItem item;
	
    SubMenu subMenu1 = menu.addSubMenu(getString(R.string.attach));
       subMenu1.add(0, 1001, 0, getString(R.string.camera));
       subMenu1.add(0, 1002, 0, getString(R.string.choose_picture));
       subMenu1.add(0, 1003, 0, getString(R.string.attach_file));
      // subMenu1.add(0, 1004, 0, "목록");
    if(attach_exist) subMenu1.add(0, 1005, 0, getString(R.string.delete));

       MenuItem subMenu1Item = subMenu1.getItem();
     

	menu.add(0, 2, 0, getString(R.string.privacy_content)).setShowAsAction(
			MenuItem.SHOW_AS_ACTION_NEVER);
	  subMenu1Item.setIcon(R.drawable.ic_file_light);
        subMenu1Item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
	menu.add(0, 1, 0, getString(R.string.write)).setIcon(R.drawable.accept)
			.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);

	return true;

}
 
Example 3
Source File: MenuWrapper.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}
 
Example 4
Source File: not_covered_not_covered_s.java    From coming with MIT License 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}
 
Example 5
Source File: not_covered_not_covered_t.java    From coming with MIT License 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}
 
Example 6
Source File: MenuWrapper.java    From android-apps with MIT License 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}
 
Example 7
Source File: MenuWrapper.java    From zen4android with MIT License 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}
 
Example 8
Source File: MenuWrapper.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}
 
Example 9
Source File: MenuWrapper.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
    SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
    android.view.MenuItem nativeItem = nativeSubMenu.getItem();
    MenuItem item = subMenu.getItem();
    mNativeMap.put(nativeItem, item);
    return subMenu;
}