List of usage examples for android.app Activity onPrepareOptionsMenu
public boolean onPrepareOptionsMenu(Menu menu)
From source file:com.vuze.android.remote.AndroidUtilsUI.java
public static boolean popupContextMenu(final Activity activity, String title) { MenuBuilder menuBuilder = new MenuBuilder(activity); if (title != null) { try {// w w w. j av a 2s . c om Method mSetHeaderTitle = menuBuilder.getClass().getDeclaredMethod("setHeaderTitleInt", CharSequence.class); if (mSetHeaderTitle != null) { mSetHeaderTitle.setAccessible(true); mSetHeaderTitle.invoke(menuBuilder, title); } } catch (Throwable ignore) { } } if (!activity.onCreateOptionsMenu(menuBuilder)) { return false; } activity.onPrepareOptionsMenu(menuBuilder); menuBuilder.setCallback(new MenuBuilder.Callback() { @Override public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) { return activity.onOptionsItemSelected(item); } @Override public void onMenuModeChange(MenuBuilder menu) { } }); MenuDialogHelper menuDialogHelper = new MenuDialogHelper(menuBuilder); menuDialogHelper.show(null); return true; }