Example #1
0
  @Override
  public void onBackPressed() {
    // if we are in hieratical list, go back one level
    HieraticalHostListView hlv = null;
    if (getTabHost().getCurrentTabTag().equals("tab_status")) {
      hlv = (HieraticalHostListView) findViewById(R.id.hosts_status);
    } else if (getTabHost().getCurrentTabTag().equals("tab_checks")) {
      hlv = (HieraticalHostListView) findViewById(R.id.hosts_checks);
    }

    ViewFlipper vf_screens = (ViewFlipper) findViewById(R.id.view_switcher_screens);

    if (hlv != null && hlv.getDisplayedChild() > 0) {
      hlv.showPrevious();
    } else if (getTabHost().getCurrentTabTag().equals("tab_graphs")) {
      // if we are at graphs, jump to the previsous tab
      getTabHost().setCurrentTabByTag(prevTabTag != null ? prevTabTag : "tab_checks");
    } else if (getTabHost().getCurrentTabTag().equals("tab_screens")
        && vf_screens.getDisplayedChild() == 1) {
      // if we are at screens, jump back to the list
      vf_screens.showPrevious();
      // hide empty view for sure
      findViewById(R.id.listview_screens_empty).setVisibility(View.GONE);
      lastShowScreen_screen__id = -1;
    } else {
      super.onBackPressed();
    }
  }
Example #2
0
 @Override
 public void onBackPressed() {
   if (!exitOnDoubleBack()) {
     super.onBackPressed();
   } else {
     if (lastBackPressed + BACK_TIME_DELAY > System.currentTimeMillis()) {
       super.onBackPressed();
     } else {
       Tools.toast(
           getBaseContext(),
           getToastIconId(),
           getResources().getText(getOnDoubleBackExitTextId()));
     }
     lastBackPressed = System.currentTimeMillis();
   }
 }
Example #3
0
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   finish();
 }
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   overridePendingTransition(R.layout.animation_fadein, R.layout.animation_fadeout);
 }
 public void ReturnButton(View v) {
   //   Log.i("test", "returen");
   super.onBackPressed();
 }