コード例 #1
1
 @Override
 public void onBackPressed() {
   if (DisplayUtils.isTablet(this)) {
     super.onBackPressed();
   } else {
     if (mSlidingPanelLayout != null && !mIsPanelCollapsed) mSlidingPanelLayout.collapsePane();
     else super.onBackPressed();
   }
 }
コード例 #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();
 }
コード例 #3
1
 @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);
 }
コード例 #4
1
 @Override
 public void onBackPressed() {
   // TODO Auto-generated method stub
   super.onBackPressed();
   Intent intent = new Intent(ProviderList.this, StartScreen.class);
   startActivity(intent);
 }
コード例 #5
1
 @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();
  }
コード例 #7
0
 @Override
 public void onBackPressed() {
   Intent intent = new Intent();
   intent.putExtra(Constants.SELECTED_POSITION, customActionBar.selectedIndex());
   setResult(Activity.RESULT_CANCELED, intent);
   super.onBackPressed();
 }
コード例 #8
0
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   Intent i = new Intent(this, ActivityTabs.class);
   startActivity(i);
   finish();
 }
コード例 #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();
 }
コード例 #10
0
ファイル: Welcome.java プロジェクト: gtx1049/CardWar
 @Override
 public void onBackPressed() {
   // TODO Auto-generated method stub
   super.onBackPressed();
   Datamanager.getInstance().clearMemory();
   this.finish();
 }
コード例 #11
0
 @Override
 public void onBackPressed() {
   if (lock != null) {
     lock.stop();
   }
   super.onBackPressed();
 }
コード例 #12
0
  @Override
  public void onBackPressed() {

    super.onBackPressed();
    TabGroup2Activity parentActivity = (TabGroup2Activity) getParent();
    parentActivity.onBackPressed();
  }
コード例 #13
0
  @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();
  }
コード例 #14
0
ファイル: CustomVideoPlayer.java プロジェクト: kj0604/CarAvn
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   if (mediaPlayer.isPlaying()) mediaPlayer.stop();
   if (mediaPlayer != null) mediaPlayer.release();
   finish();
 }
コード例 #15
0
  @Override
  public void onBackPressed() {

    // set the flag to true so the next activity won't start up
    mIsBackButtonPressed = true;
    super.onBackPressed();
  }
コード例 #16
0
ファイル: MainScreen.java プロジェクト: southasia/DGMS
  @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();
    }
  }
コード例 #17
0
 @Override
 public void onBackPressed() {
   if (handler != null && pageLauncher != null) {
     handler.removeCallbacks(pageLauncher);
   }
   super.onBackPressed();
 }
コード例 #18
0
  // pressing back button finishes this activity
  public void onBackPressed() {
    // writeProgress(completed_downloads,total_files_to_download);
    downloadThread.requestStop();
    super.onBackPressed();

    // download_photos.this.finish();
  }
コード例 #19
0
 public void onBackPressed() {
   IBackPressedListener backPressedListener =
       (IBackPressedListener) mTabsAdapter.getItem(mViewPager.getCurrentItem());
   if (!backPressedListener.onBack()) {
     super.onBackPressed();
   }
 }
コード例 #20
0
ファイル: PrivateStatus.java プロジェクト: Reno6954/kanailabo
 @Override
 public void onBackPressed() {
   // TODO 自動生成されたメソッド・スタブ
   setResult();
   super.onBackPressed();
   Log.v("private status", "call onBackPressed");
 }
コード例 #21
0
 @Override
 public void onBackPressed() { // android系统调用
   Logger.d("sgh", "onBackPressed before super");
   super.onBackPressed();
   Logger.d("sgh", "onBackPressed");
   basePlayerManager.onBackPressed();
 }
コード例 #22
0
ファイル: GroupList.java プロジェクト: EdikHU/Pricer2ws
 @Override
 public void onBackPressed() {
   Intent intent = new Intent();
   intent.putExtra(ProductDetail.PRODUCT_DETAIL_FIELD_GROUP, group);
   setResult(RESULT_OK, intent);
   super.onBackPressed();
 }
コード例 #23
0
  @Override
  public void onBackPressed() {
    super.onBackPressed();

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

  }
コード例 #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();
 }
コード例 #27
0
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   if (mLoginAsyncTask != null) {
     mLoginAsyncTask.cancelTask(true);
     DebugUtils.logD(TAG, "login or update is canceled by user");
   }
 }
コード例 #28
0
  @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();
   }
 }
コード例 #30
0
ファイル: DirChooser.java プロジェクト: edmoody/TurtlePlayer
 @Override
 public void onBackPressed() {
   if (navigationStack.empty()) {
     super.onBackPressed();
   } else {
     setCurrDir(navigationStack.pop());
   }
 }