@Test public void onOptionsItemSelectedTest() { final boolean consumeHere = postActivity.onOptionsItemSelected(homeMenuItem); assertThat(consumeHere).isTrue(); }
@Override public boolean onOptionsItemSelected(final MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); }
PostActivity extends AbstractAppActivity implements PostView { @Override public boolean onOptionsItemSelected(final MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); } }
PostActivity extends AbstractAppActivity implements PostView { @Override public boolean onOptionsItemSelected(final MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); }  }
PostActivity extends AbstractAppActivity implements PostView { @Override public boolean onOptionsItemSelected(final MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); }  @Override void loadPostUserAndPost(); @Override void loadPostUser(final String userEmail, final String userName, final String userUsername); @Override void notifyUserAboutUserUnavailability(); @Override void notifyUserAboutInternetUnavailability(); @Override void loadPost(final String postTitle, final String postBody, final String numberOfComments); @Override void notifyUserAboutPostUnavailability(); @Override void showError(); @Override boolean onOptionsItemSelected(final MenuItem item); }
PostActivity extends AbstractAppActivity implements PostView { @Override public boolean onOptionsItemSelected(final MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); }  @Override void loadPostUserAndPost(); @Override void loadPostUser(final String userEmail, final String userName, final String userUsername); @Override void notifyUserAboutUserUnavailability(); @Override void notifyUserAboutInternetUnavailability(); @Override void loadPost(final String postTitle, final String postBody, final String numberOfComments); @Override void notifyUserAboutPostUnavailability(); @Override void showError(); @Override boolean onOptionsItemSelected(final MenuItem item);  }