List of usage examples for android.view Menu hasVisibleItems
public boolean hasVisibleItems();
From source file:org.melky.geekjuniorapp.LicenseGeekFragment.java
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); if (menu.hasVisibleItems()) menu.removeItem(menu.getItem(0).getItemId()); }
From source file:net.idlesoft.android.apps.github.activities.BranchesList.java
@Override public boolean onPrepareOptionsMenu(final Menu menu) { if (!menu.hasVisibleItems()) { menu.add(0, 0, 0, "Back to Main").setIcon(android.R.drawable.ic_menu_revert); menu.add(0, 1, 0, "Clear Preferences"); menu.add(0, 2, 0, "Clear Cache"); }// w ww. j a va 2 s .c o m return true; }
From source file:net.idlesoft.android.apps.github.activities.NewsFeed.java
@Override public boolean onPrepareOptionsMenu(final Menu menu) { if (!menu.hasVisibleItems()) { if (!mUsername.equals(null) && !mPassword.equals(null)) { menu.add(0, 1, 0, "Sign out"); }/*ww w .ja v a 2s . c o m*/ menu.add(0, 2, 0, "Clear Cache"); } return true; }
From source file:com.social.solution.activity.TrendingTweetsActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { menu.clear();//from w ww .ja va 2 s . co m getMenuInflater().inflate(R.menu.mymenutrend, menu); System.out.println("pranjal menu has visible items " + menu.hasVisibleItems()); return true; }
From source file:net.idlesoft.android.apps.github.activities.Repository.java
@Override public boolean onPrepareOptionsMenu(final Menu menu) { if (menu.hasVisibleItems()) { menu.clear();//w w w. ja v a 2 s . c o m } if (mIsWatching) { menu.add(0, 3, 0, "Unwatch"); } else { menu.add(0, 3, 0, "Watch"); } menu.add(0, 0, 0, "Back to Main").setIcon(android.R.drawable.ic_menu_revert); menu.add(0, 1, 0, "Clear Preferences"); menu.add(0, 2, 0, "Clear Cache"); return true; }
From source file:net.idlesoft.android.apps.github.activities.SingleActivityItem.java
public boolean onPrepareOptionsMenu(final Menu menu) { if (menu.hasVisibleItems()) { menu.clear();/* w w w . ja va 2s . com*/ } menu.add(0, 0, 0, "Back to Main").setIcon(android.R.drawable.ic_menu_revert); menu.add(0, 1, 0, "Clear Preferences"); menu.add(0, 2, 0, "Clear Cache"); return true; }
From source file:com.github.howeyc.slideshow.activities.MainActivity.java
@Override public boolean onPrepareOptionsMenu(Menu menu) { if (menu == null || !menu.hasVisibleItems()) return super.onPrepareOptionsMenu(menu); menu.findItem(R.id.action_download).setVisible(false); return true;// w ww . j ava 2s . com }
From source file:picframe.at.picframe.activities.MainActivity.java
@Override public boolean onPrepareOptionsMenu(Menu menu) { if (menu == null || !menu.hasVisibleItems()) return super.onPrepareOptionsMenu(menu); if (AppData.getSourceType() == AppData.sourceTypes.OwnCloud) { menu.findItem(R.id.action_download).setVisible(true); } else {//w ww.j av a 2 s . com menu.findItem(R.id.action_download).setVisible(false); } return true; }
From source file:com.google.android.demos.jamendo.app.PlaylistActivity.java
@Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); int groupId = MENU_GROUP_INTENT_OPTIONS; int itemId = Menu.NONE; int order = Menu.NONE; ComponentName caller = getComponentName(); Intent[] specifics = null;/* w w w. j a va2 s . c om*/ Intent intent = new Intent(); long id = ContentUris.parseId(getIntent().getData()); intent.setDataAndType(JamendoContract.createPlaylistUri(JamendoContract.FORMAT_M3U, Playlists.ID, id), JamendoContract.CONTENT_TYPE_M3U); intent.addCategory(Intent.CATEGORY_ALTERNATIVE); int flags = 0; MenuItem[] outSpecificItems = null; menu.addIntentOptions(groupId, itemId, order, caller, specifics, intent, flags, outSpecificItems); return menu.hasVisibleItems(); }
From source file:com.google.android.demos.jamendo.app.AlbumActivity.java
@Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); int groupId = MENU_GROUP_INTENT_OPTIONS; int itemId = Menu.NONE; int order = Menu.NONE; ComponentName caller = getComponentName(); Intent[] specifics = null;/*from www . j a v a 2s .c om*/ Intent intent = new Intent(); long id = ContentUris.parseId(getIntent().getData()); intent.setDataAndType(JamendoContract.createPlaylistUri(JamendoContract.FORMAT_M3U, Albums.ID, id), JamendoContract.CONTENT_TYPE_M3U); intent.addCategory(Intent.CATEGORY_ALTERNATIVE); int flags = 0; MenuItem[] outSpecificItems = null; menu.addIntentOptions(groupId, itemId, order, caller, specifics, intent, flags, outSpecificItems); return menu.hasVisibleItems(); }