@Override public boolean onOptionsItemSelected(MenuItem menuItem) { if (menuItem.getItemId() == android.R.id.home) { super.onBackPressed(); } return super.onOptionsItemSelected(menuItem); }
@Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); upArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha); if (upArrow != null) { upArrow.setColorFilter(android.R.color.white, PorterDuff.Mode.SRC_ATOP); } getSupportActionBar().setHomeAsUpIndicator(upArrow); getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); }