コード例 #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();
    }
  }
コード例 #2
0
ファイル: EffectTabActivity.java プロジェクト: Keidan/ATK
 @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();
   }
 }
コード例 #3
0
ファイル: BazaarTabs.java プロジェクト: iriina/wouso-extras
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   finish();
 }
コード例 #4
0
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   overridePendingTransition(R.layout.animation_fadein, R.layout.animation_fadeout);
 }
コード例 #5
0
 public void ReturnButton(View v) {
   //   Log.i("test", "returen");
   super.onBackPressed();
 }