@Override
 public void onBackPressed() {
   if (DisplayUtils.isTablet(this)) {
     super.onBackPressed();
   } else {
     if (mSlidingPanelLayout != null && !mIsPanelCollapsed) mSlidingPanelLayout.collapsePane();
     else super.onBackPressed();
   }
 }
Example #2
1
 @Override
 public void onBackPressed() {
   Log.d(TAG, "onBackPressed");
   if (mProgramming) {
     Toast.makeText(this, R.string.prog_ogoing, Toast.LENGTH_LONG).show();
   } else super.onBackPressed();
 }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case android.R.id.home:
       // This ID represents the Home or Up button. In the case of this
       // activity, the Up button is shown. Use NavUtils to allow users
       // to navigate up one level in the application structure. For
       // more details, see the Navigation pattern on Android Design:
       //
       // http://developer.android.com/design/patterns/navigation.html#up-vs-back
       //
       // NavUtils.navigateUpFromSameTask(this);
       super.onBackPressed();
       return true;
     case R.id.network_info:
       NetworkDialogFragment ndf = NetworkDialogFragment.newInstance();
       ndf.show(getFragmentManager(), "networkInfo");
       return true;
     case R.id.help:
       HelpDialogFragment hdf =
           HelpDialogFragment.newInstance(
               getString(R.string.help_title_network_config),
               getString(R.string.help_text_network_config));
       hdf.show(getFragmentManager(), "help");
       return true;
   }
   return super.onOptionsItemSelected(item);
 }
 @Override
 public void onBackPressed() {
   // TODO Auto-generated method stub
   super.onBackPressed();
   Intent intent = new Intent(ProviderList.this, StartScreen.class);
   startActivity(intent);
 }
 @Override
 public void onBackPressed() {
   adapter.clear();
   adapter.clearCache();
   setResult(RESULT_CANCELED);
   super.onBackPressed();
 }
  @Override
  public void onBackPressed() {
    Log.i(this, "onBackPressed");

    // BACK is also used to exit out of any "special modes" of the
    // in-call UI:

    if (!mConferenceManagerFragment.isVisible() && !mCallCardFragment.isVisible()) {
      return;
    }

    if (mDialpadFragment != null && mDialpadFragment.isVisible()) {
      mCallButtonFragment.displayDialpad(false /* show */, true /* animate */);
      return;
    } else if (mConferenceManagerFragment.isVisible()) {
      showConferenceCallManager(false);
      return;
    }

    // Always disable the Back key while an incoming call is ringing
    final Call call = CallList.getInstance().getIncomingCall();
    if (call != null) {
      Log.d(this, "Consume Back press for an incoming call");
      return;
    }

    // Nothing special to do.  Fall back to the default behavior.
    super.onBackPressed();
  }
 @Override
 public void onBackPressed() {
   Intent intent = new Intent();
   intent.putExtra(Constants.SELECTED_POSITION, customActionBar.selectedIndex());
   setResult(Activity.RESULT_CANCELED, intent);
   super.onBackPressed();
 }
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   Intent i = new Intent(this, ActivityTabs.class);
   startActivity(i);
   finish();
 }
Example #9
0
 /** Load device home screen. */
 private void loadHomeScreen() {
   Intent i = new Intent();
   i.setAction(Intent.ACTION_MAIN);
   i.addCategory(Intent.CATEGORY_HOME);
   this.startActivity(i);
   super.onBackPressed();
 }
Example #10
0
 @Override
 public void onBackPressed() {
   // TODO Auto-generated method stub
   super.onBackPressed();
   Datamanager.getInstance().clearMemory();
   this.finish();
 }
Example #11
0
 @Override
 public void onBackPressed() {
   if (lock != null) {
     lock.stop();
   }
   super.onBackPressed();
 }
  @Override
  public void onBackPressed() {

    super.onBackPressed();
    TabGroup2Activity parentActivity = (TabGroup2Activity) getParent();
    parentActivity.onBackPressed();
  }
  @Override
  public void onBackPressed() {
    backClickCount++;

    ActivityManager mngr = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
    List<ActivityManager.RunningTaskInfo> taskList = mngr.getRunningTasks(10);

    if (taskList.get(0).numActivities == 1
        && taskList
            .get(0)
            .topActivity
            .getClassName()
            .equals("com.rabin.jobportal.EmployerSection")) {

      new Handler()
          .postDelayed(
              new Runnable() {
                @Override
                public void run() {
                  backClickCount = 0;
                }
              },
              2000);

      if (backClickCount == 1) {
        Toast.makeText(getApplicationContext(), "Press back again to exit.", Toast.LENGTH_SHORT)
            .show();
      } else {
        backClickCount = 0;
        finish();
      }

    } else super.onBackPressed();
  }
Example #14
0
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   if (mediaPlayer.isPlaying()) mediaPlayer.stop();
   if (mediaPlayer != null) mediaPlayer.release();
   finish();
 }
  @Override
  public void onBackPressed() {

    // set the flag to true so the next activity won't start up
    mIsBackButtonPressed = true;
    super.onBackPressed();
  }
Example #16
0
  @Override
  public void onBackPressed() {
    if (Game.hasSavedData()) {
      AlertDialog.Builder alert = new AlertDialog.Builder(this);

      alert.setTitle("Save game?");

      alert.setPositiveButton(
          "Save",
          new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
              Game.saveGame(true);
              goBack();
            }
          });

      alert.setNegativeButton(
          "No",
          new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
              Game.saveGame(false);
              goBack();
            }
          });

      alert.show();
    } else {
      super.onBackPressed();
    }
  }
 @Override
 public void onBackPressed() {
   if (handler != null && pageLauncher != null) {
     handler.removeCallbacks(pageLauncher);
   }
   super.onBackPressed();
 }
  // pressing back button finishes this activity
  public void onBackPressed() {
    // writeProgress(completed_downloads,total_files_to_download);
    downloadThread.requestStop();
    super.onBackPressed();

    // download_photos.this.finish();
  }
 public void onBackPressed() {
   IBackPressedListener backPressedListener =
       (IBackPressedListener) mTabsAdapter.getItem(mViewPager.getCurrentItem());
   if (!backPressedListener.onBack()) {
     super.onBackPressed();
   }
 }
Example #20
0
 @Override
 public void onBackPressed() {
   // TODO 自動生成されたメソッド・スタブ
   setResult();
   super.onBackPressed();
   Log.v("private status", "call onBackPressed");
 }
 @Override
 public void onBackPressed() { // android系统调用
   Logger.d("sgh", "onBackPressed before super");
   super.onBackPressed();
   Logger.d("sgh", "onBackPressed");
   basePlayerManager.onBackPressed();
 }
Example #22
0
 @Override
 public void onBackPressed() {
   Intent intent = new Intent();
   intent.putExtra(ProductDetail.PRODUCT_DETAIL_FIELD_GROUP, group);
   setResult(RESULT_OK, intent);
   super.onBackPressed();
 }
  @Override
  public void onBackPressed() {
    super.onBackPressed();

    finish();
    overridePendingTransition(R.anim.trans_right_in, R.anim.trans_right_out);
  }
 @Override
 public void onBackPressed() {
   if (mReactInstanceManager != null) {
     mReactInstanceManager.onBackPressed();
   } else {
     super.onBackPressed();
   }
 }
  @Override
  public void onBackPressed() {
    // TODO Auto-generated method stub
    // helper.updateIronCount();
    super.onBackPressed();
    // clearPreference();

  }
Example #26
0
 public void onBackPressed() {
   setResult(RESULT_OK, this.getIntent());
   super.onBackPressed();
   //        Intent i=new Intent(BudgetActivity.this,MainTabActivity.class);//  MainActivity
   // MainTabActivity
   //        startActivity(i);
   //        BudgetActivity.this.finish();
 }
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   if (mLoginAsyncTask != null) {
     mLoginAsyncTask.cancelTask(true);
     DebugUtils.logD(TAG, "login or update is canceled by user");
   }
 }
  @Test
  public void shouldCallFinishInOnBackPressed() {
    Activity activity = new Activity();
    activity.onBackPressed();

    ShadowActivity shadowActivity = shadowOf(activity);
    assertTrue(shadowActivity.isFinishing());
  }
 @Override
 public void onBackPressed() {
   if (mWebView.canGoBack()) {
     mWebView.goBack();
   } else {
     super.onBackPressed();
   }
 }
Example #30
0
 @Override
 public void onBackPressed() {
   if (navigationStack.empty()) {
     super.onBackPressed();
   } else {
     setCurrDir(navigationStack.pop());
   }
 }