@Test public void shouldFinishMainActivityAndStartLoginActivityWhenSighOutClicked() { MenuItem signoutAction = new RoboMenuItem(R.id.action_sign_out); homeActivity.onOptionsItemSelected(signoutAction); assertTrue(homeActivity.isFinishing()); verifyNextPage(LoginActivity.class.getName()); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_sign_out: startActivity(LoginActivity.class); finish(); return true; case R.id.action_sync_data: syncData(); return true; case R.id.action_wipe_data: alertWipeData(); return true; case R.id.action_export_db: exportDB(); return true; default: return super.onOptionsItemSelected(item); } }
HomeActivity extends BaseActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_sign_out: startActivity(LoginActivity.class); finish(); return true; case R.id.action_sync_data: syncData(); return true; case R.id.action_wipe_data: alertWipeData(); return true; case R.id.action_export_db: exportDB(); return true; default: return super.onOptionsItemSelected(item); } } }
HomeActivity extends BaseActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_sign_out: startActivity(LoginActivity.class); finish(); return true; case R.id.action_sync_data: syncData(); return true; case R.id.action_wipe_data: alertWipeData(); return true; case R.id.action_export_db: exportDB(); return true; default: return super.onOptionsItemSelected(item); } }  }
HomeActivity extends BaseActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_sign_out: startActivity(LoginActivity.class); finish(); return true; case R.id.action_sync_data: syncData(); return true; case R.id.action_wipe_data: alertWipeData(); return true; case R.id.action_export_db: exportDB(); return true; default: return super.onOptionsItemSelected(item); } }  void onClickStockCard(View view); void onClickKitStockCard(View view); void onClickInventory(View view); void onClickPatientDataReport(View view); void onClickRapidTestHistory(View view); void onClickAL(View view); void syncData(); void onClickMMIAHistory(View view); void onClickVIAHistory(View view); void onClickPtvStockCard(View view); @Override void onBackPressed(); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onPrepareOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); static Intent getIntentToMe(Context context); }
HomeActivity extends BaseActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_sign_out: startActivity(LoginActivity.class); finish(); return true; case R.id.action_sync_data: syncData(); return true; case R.id.action_wipe_data: alertWipeData(); return true; case R.id.action_export_db: exportDB(); return true; default: return super.onOptionsItemSelected(item); } }  void onClickStockCard(View view); void onClickKitStockCard(View view); void onClickInventory(View view); void onClickPatientDataReport(View view); void onClickRapidTestHistory(View view); void onClickAL(View view); void syncData(); void onClickMMIAHistory(View view); void onClickVIAHistory(View view); void onClickPtvStockCard(View view); @Override void onBackPressed(); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onPrepareOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); static Intent getIntentToMe(Context context);  }