예제 #1
0
 @Override
 public boolean onOptionsItemSelected(MenuItem menuItem) {
   if (menuItem.getItemId() == android.R.id.home) {
     super.onBackPressed();
   }
   return super.onOptionsItemSelected(menuItem);
 }
예제 #2
0
 @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);
 }