android.app.Activity.onBackPressed()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(235)

本文整理了Java中android.app.Activity.onBackPressed()方法的一些代码示例,展示了Activity.onBackPressed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onBackPressed()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onBackPressed

Activity.onBackPressed介绍

暂无

代码示例

代码示例来源:origin: aa112901/remusic

@Override
  public void onClick(View v) {
    mContext.onBackPressed();
  }
});

代码示例来源:origin: aa112901/remusic

@Override
  public void onClick(View v) {
    mContext.onBackPressed();
  }
});

代码示例来源:origin: donglua/PhotoPicker

@Override public void onClick(View view) {
  if (context instanceof Activity) {
   if (!((Activity) context).isFinishing()) {
    ((Activity) context).onBackPressed();
   }
  }
 }
});

代码示例来源:origin: square/leakcanary

@Override public void onBackPressed() {
 if (visibleLeakRefKey != null) {
  visibleLeakRefKey = null;
  updateUi();
 } else {
  super.onBackPressed();
 }
}

代码示例来源:origin: robolectric/robolectric

@Override
 public void onBackPressed() {
  onBackPressedCalled = true;
  super.onBackPressed();
 }
}

代码示例来源:origin: lipangit/JiaoZiVideoPlayer

@Override
public void onBackPressed() {
  if (Jzvd.backPress()) {
    return;
  }
  super.onBackPressed();
}

代码示例来源:origin: Bilibili/DanmakuFlameMaster

@Override
public void onBackPressed() {
  super.onBackPressed();
  if (mDanmakuView != null) {
    // dont forget release!
    mDanmakuView.release();
    mDanmakuView = null;
  }
}

代码示例来源:origin: Bilibili/DanmakuFlameMaster

@Override
public void onBackPressed() {
  super.onBackPressed();
  if (mDanmakuView != null) {
    // dont forget release!
    mDanmakuView.release();
    mDanmakuView = null;
  }
}

代码示例来源:origin: markzhai/AndroidPerformanceMonitor

@Override
public void onBackPressed() {
  if (mBlockStartTime != null) {
    mBlockStartTime = null;
    updateUi();
  } else {
    super.onBackPressed();
  }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onBackPressed() {
 if (!isLeftShowing) {
  root.showLeft();
  isLeftShowing=true;
 }
 else {
  super.onBackPressed();
 }
}

代码示例来源:origin: ArthurHub/Android-Image-Cropper

@Override
public void onBackPressed() {
 releaseBitmap();
 super.onBackPressed();
}

代码示例来源:origin: JackyAndroid/AndroidTVLauncher

@Override
public void onBackPressed() {
  if (JCVideoPlayer.backPress()) {
    return;
  }
  super.onBackPressed();
}

代码示例来源:origin: jjdxmashl/jjdxm_ijkplayer

@Override
public void onBackPressed() {
  if (player != null && player.onBackPressed()) {
    return;
  }
  super.onBackPressed();
  if (wakeLock != null) {
    wakeLock.release();
  }
}

代码示例来源:origin: jjdxmashl/jjdxm_ijkplayer

@Override
public void onBackPressed() {
  if (player != null && player.onBackPressed()) {
    return;
  }
  super.onBackPressed();
}

代码示例来源:origin: nostra13/Android-Universal-Image-Loader

@Override
public void onBackPressed() {
  ImageLoader.getInstance().stop();
  super.onBackPressed();
}

代码示例来源:origin: nickbutcher/plaid

@Override
public void onBackPressed() {
  if (drawer.isDrawerOpen(GravityCompat.END)) {
    drawer.closeDrawer(GravityCompat.END);
  } else {
    super.onBackPressed();
  }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onBackPressed() {
 if (panes.isOpen()) {
  super.onBackPressed();
 }
 else {
  panes.openPane();
 }
}

代码示例来源:origin: termux/termux-app

@Override
public void onBackPressed() {
  if (mWebView.canGoBack()) {
    mWebView.goBack();
  } else {
    super.onBackPressed();
  }
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

@Override
  public void onBackPressed() {
    super.onBackPressed();
    Log.d(TAG, "BaseActivity onBackPressed Invoke...");
    ManagerActivity.getInstance().removeActivity(this);
  }
}

代码示例来源:origin: robolectric/robolectric

@Test
public void shouldCallFinishInOnBackPressed() {
 Activity activity = new Activity();
 activity.onBackPressed();
 assertTrue(activity.isFinishing());
}

相关文章

Activity类方法