public MenuItemAssert hasIntent(Intent intent) { isNotNull(); Intent actualIntent = actual.getIntent(); assertThat(actualIntent) // .overridingErrorMessage("Expected intent <%s> but was <%s>.", intent, actualIntent) // .isEqualTo(intent); return this; }
@Override public Intent getIntent() { return mNativeItem.getIntent(); }
@Override public Intent getIntent() { return mNativeItem.getIntent(); }
@Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub switch (item.getItemId()) { case 100: LevelOptionIntent levelOptionIntent = (LevelOptionIntent) item .getIntent(); //Perform what you would want to based on the values set in the intent. if (levelOptionIntent.getAppCode().equals(A)) { // Start activity A }elseif (levelOptionIntent.getAppCode().equals(B)) { // Start activity B }else if (levelOptionIntent.getAppCode().equals(C)) { // Start activity C } break; } return true; }
//Methods for menu // display the menu when menu botton clicked @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.lightmeter, menu); menu.findItem(R.id.about).setIntent(new Intent(this, about.class)); menu.findItem(R.id.edit).setIntent(new Intent(this, menu.class)); return true; } //methods for menu //StartActivity for selecion @Override public boolean onOptionsItemSelected(MenuItem item) { super.onOptionsItemSelected(item); startActivity(item.getIntent()); return true; }
public static void setActionParameters(final MenuItem item, final ActionEx action) { final Intent intent = item.getIntent(); final Bundle extras = intent != null ? intent.getExtras() : null; if (extras != null) { for (final String key : extras.keySet()) { final ExtraWrapper w = (ExtraWrapper) extras.getSerializable(key); action.putValue(key, w != null ? w.data : null); } } }
public MenuItemAssert hasIntent(Intent intent) { isNotNull(); Intent actualIntent = actual.getIntent(); assertThat(actualIntent) // .overridingErrorMessage("Expected intent <%s> but was <%s>.", intent, actualIntent) // .isEqualTo(intent); return this; }
public static void setMenuItemExtra(final MenuItem item, final String name, final Object data) { Intent intent = item.getIntent(); if (intent == null) { intent = new Intent(); item.setIntent(intent); } intent.putExtra(name, new ExtraWrapper(data)); }
int posGroup = item.getIntent().getIntExtra(CONTEXT_MENU_KEY_INTENT_DATA_POS, -1); if(((String)listGroup.get(posGroup).groupInfo.get("admin")).equals(StaticConfig.UID)) { Group group = listGroup.get(posGroup); int posGroup1 = item.getIntent().getIntExtra(CONTEXT_MENU_KEY_INTENT_DATA_POS, -1); if(((String)listGroup.get(posGroup1).groupInfo.get("admin")).equals(StaticConfig.UID)) { Intent intent = new Intent(getContext(), AddGroupActivity.class); int position = item.getIntent().getIntExtra(CONTEXT_MENU_KEY_INTENT_DATA_POS, -1); if(((String)listGroup.get(position).groupInfo.get("admin")).equals(StaticConfig.UID)) { Toast.makeText(getActivity(), "Admin cannot leave group", Toast.LENGTH_LONG).show();
Intent i = item.getIntent(); if (i != null) { Bundle b = i.getExtras();
Intent i = item.getIntent(); if (i != null) { Bundle b = i.getExtras();
public boolean onMenuItemClick(MenuItem item) { prepareImageToShare(true); startActivity(item.getIntent()); return true;
@Override public boolean onContextItemSelected(final MenuItem item) { if (item.getIntent() == null && contextMenuApplicationModel != null) { switch (item.getItemId()) { case ITEM_RESET: new ResetUsageAsyncTask(this, model).execute(contextMenuApplicationModel); break; case ITEM_TOGGLE_DISABLED: new ToggleDockAsyncTask(this, model).execute(contextMenuApplicationModel); break; case ITEM_TOGGLE_STICKY: new ToggleStickyAsyncTask(this, model).execute(contextMenuApplicationModel); break; case ITEM_TOGGLE_HIDDEN: new ToggleHiddenAsyncTask(this, model).execute(contextMenuApplicationModel); break; default: break; } // "Consume" the model contextMenuApplicationModel = null; return true; } return false; }
startTextSelectionActivity(item.getIntent());