本文整理了Java中android.view.Menu.addIntentOptions()
方法的一些代码示例,展示了Menu.addIntentOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Menu.addIntentOptions()
方法的具体详情如下:
包路径:android.view.Menu
类名称:Menu
方法名:addIntentOptions
暂无
代码示例来源:origin: com.actionbarsherlock/actionbarsherlock
@Override
public int addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) {
int result;
if (outSpecificItems != null) {
android.view.MenuItem[] nativeOutItems = new android.view.MenuItem[outSpecificItems.length];
result = mNativeMenu.addIntentOptions(groupId, itemId, order, caller, specifics, intent, flags, nativeOutItems);
for (int i = 0, length = outSpecificItems.length; i < length; i++) {
outSpecificItems[i] = new MenuItemWrapper(nativeOutItems[i]);
}
} else {
result = mNativeMenu.addIntentOptions(groupId, itemId, order, caller, specifics, intent, flags, null);
}
return result;
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);
// Create an Intent that describes the requirements to fulfill, to be included
// in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE.
Intent intent = new Intent(null, dataUri);
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
// Search and populate the menu with acceptable offering applications.
menu.addIntentOptions(
R.id.intent_group, // Menu group to which new items will be added
0, // Unique item ID (none)
0, // Order for the items (none)
this.getComponentName(), // The current Activity name
null, // Specific items to place first (none)
intent, // Intent created above that describes our requirements
0, // Additional flags to control items (none)
null); // Array of MenuItems that correlate to specific items (none)
return true;
}
代码示例来源:origin: com.willowtreeapps/oak-demos
@Override
public int addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) {
android.view.MenuItem[] nativeOutItems = new android.view.MenuItem[outSpecificItems.length];
int result = mNativeMenu.addIntentOptions(groupId, itemId, order, caller, specifics, intent, flags, nativeOutItems);
for (int i = 0, length = outSpecificItems.length; i < length; i++) {
outSpecificItems[i] = new MenuItemWrapper(nativeOutItems[i]);
}
return result;
}
代码示例来源:origin: retomeier/Wrox-ProfessionalAndroid-4E
menu.addIntentOptions(menuGroup,
menuItemId,
menuItemOrder,
代码示例来源:origin: ogarcia/opensudoku
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// This is our one standard application action -- inserting a
// new note into the list.
menu.add(0, MENU_ITEM_SAVE, 0, R.string.save)
.setShortcut('1', 's')
.setIcon(R.drawable.ic_save);
menu.add(0, MENU_ITEM_CANCEL, 1, android.R.string.cancel)
.setShortcut('3', 'c')
.setIcon(R.drawable.ic_close);
// Generate any additional actions that can be performed on the
// overall list. In a normal install, there are no additional
// actions found here, but this allows other applications to extend
// our menu with their own actions.
Intent intent = new Intent(null, getIntent().getData());
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
new ComponentName(this, SudokuEditActivity.class), null, intent, 0, null);
return true;
}
代码示例来源:origin: ogarcia/opensudoku
menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
new ComponentName(this, SudokuListActivity.class), null,
intent, 0, null);
代码示例来源:origin: ogarcia/opensudoku
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
// This is our one standard application action -- inserting a
// new note into the list.
menu.add(0, MENU_ITEM_ADD, 0, R.string.add_folder)
.setShortcut('3', 'a')
.setIcon(R.drawable.ic_add);
menu.add(0, MENU_ITEM_IMPORT, 0, R.string.import_file)
.setShortcut('8', 'i')
.setIcon(R.drawable.ic_cloud_upload);
menu.add(0, MENU_ITEM_EXPORT_ALL, 1, R.string.export_all_folders)
.setShortcut('7', 'e')
.setIcon(R.drawable.ic_share);
menu.add(0, MENU_ITEM_SETTINGS, 2, R.string.settings)
.setShortcut('6', 's')
.setIcon(R.drawable.ic_settings);
menu.add(0, MENU_ITEM_ABOUT, 2, R.string.about)
.setShortcut('1', 'h')
.setIcon(R.drawable.ic_info);
// Generate any additional actions that can be performed on the
// overall list. In a normal install, there are no additional
// actions found here, but this allows other applications to extend
// our menu with their own actions.
Intent intent = new Intent(null, getIntent().getData());
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
new ComponentName(this, FolderListActivity.class), null, intent, 0, null);
return true;
}
代码示例来源:origin: ogarcia/opensudoku
menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
new ComponentName(this, SudokuPlayActivity.class), null, intent, 0, null);
内容来源于网络,如有侵权,请联系作者删除!