本文整理了Java中android.view.ContextMenu.clear()
方法的一些代码示例,展示了ContextMenu.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ContextMenu.clear()
方法的具体详情如下:
包路径:android.view.ContextMenu
类名称:ContextMenu
方法名:clear
暂无
代码示例来源:origin: neopixl/PixlUI
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
menu.clear();
}
});
代码示例来源:origin: stackoverflow.com
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo)
{
Log.v(TAG, "Creating context menu for view="+view);
// Clear current contents
menu.clearHeader();
menu.clear();
menu.setHeaderTitle("TEST MENU");
menu.add(Menu.NONE, Menu.FIRST+1, Menu.NONE, "Test menu");
super.onCreateContextMenu(menu, view, menuInfo);
}
代码示例来源:origin: stackoverflow.com
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo)
{
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
int position = info.position;
// use this position to decide your item clicked
menu.clear();
menu.setHeaderTitle("Context Menu Title");
String[] menuItems = getResources().getStringArray(
R.array.menu_context);
for (int i = 0; i < menuItems.length; i++)
{
menu.add(Menu.NONE, i , i, menuItems[i]);
}
menu.getItem(0).setEnabled(**Conditional check**);
menu.getItem(1).setEnabled(**Conditional check**);
menu.getItem(2).setEnabled(**Conditional check**);
}
代码示例来源:origin: PrivacyApps/document-viewer
/**
* {@inheritDoc}
*
* @see android.app.Activity#onCreateContextMenu(android.view.ContextMenu, android.view.View,
* android.view.ContextMenu.ContextMenuInfo)
*/
@Override
public void onCreateContextMenu(final ContextMenu menu, final View v, final ContextMenuInfo menuInfo) {
menu.clear();
menu.setHeaderTitle(R.string.app_name);
menu.setHeaderIcon(R.drawable.application_icon);
final MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu_context, menu);
updateMenuItems(menu);
}
代码示例来源:origin: stackoverflow.com
iMenu.clear();
for (int i = 0; i < nTotalTeam; i++) {
iMenu.add(Menu.NONE, i, Menu.NONE, teamName[i]);
内容来源于网络,如有侵权,请联系作者删除!