Esempio n. 1
0
 @Override
 protected void onUpNavigation() {
   if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
     popFragmentStack();
   } else {
     ActivityCompat.finishAfterTransition(this);
   }
 }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case android.R.id.home:
       ActivityCompat.finishAfterTransition(this);
       break;
   }
   return super.onOptionsItemSelected(item);
 }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case android.R.id.home:
       ActivityCompat.finishAfterTransition(this);
       return false;
     case R.id.menu_item_details_info:
       Snackbar.make(mChart, "Info", Snackbar.LENGTH_SHORT).show();
       break;
     case R.id.menu_item_details_navigate:
       startNavigationIntent(selectedArea);
       break;
   }
   return false;
 }
 @Override
 public void onBackPressed() {
   ActivityCompat.finishAfterTransition(this);
 }