List of usage examples for android.support.v4.view MenuItem getItemId
public int getItemId();
From source file:com.ushahidi.android.app.ui.phone.AddReportActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { showDialog();//from w ww .j a va2 s.c o m return true; } else if (item.getItemId() == R.id.menu_send) { validateReports(); return true; } else if (item.getItemId() == R.id.menu_clear) { showDialog(DIALOG_SHOW_PROMPT); return true; } return super.onOptionsItemSelected(item); }
From source file:com.flipzu.flipzu.Recorder.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Recorder.this.finish(); return true; case MENU_ITEM_LOGOUT: logoutRecorder();// ww w . j a va 2s. c o m return true; case MENU_ITEM_ABOUT: showAbout(); return true; case MENU_ITEM_SHARE_FLIPZU: shareFlipzu(); return true; case MENU_ITEM_SHARE: shareBroadcast(); return true; } return super.onOptionsItemSelected(item); }
From source file:mobisocial.musubi.ui.fragments.FeedListFragment.java
@Override public boolean onContextItemSelected(MenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); int menuItemIndex = item.getItemId(); Cursor cursor = (Cursor) mFeeds.getItem(info.position); switch (menuItemIndex) { case 0:/*w ww . j a va 2s . c o m*/ //pass the feed id in handleDelete(cursor.getLong(0)); break; case 1: //pass the feed id in handleExport(cursor.getLong(0)); break; } return true; }
From source file:com.flipzu.flipzu.Player.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Player.this.finish(); return true; case MENU_ITEM_LOGOUT: logoutPlayer();/*from w ww . j a v a2s .com*/ return true; case MENU_ITEM_ABOUT: showAbout(); return true; case MENU_ITEM_FOLLOW: followUnfollow(); return true; case MENU_ITEM_SHARE: share(); return true; case MENU_ITEM_SHARE_FLIPZU: shareFlipzu(); return true; } return super.onOptionsItemSelected(item); }