android.support.v7.app.AppCompatActivity.unregisterReceiver()方法的使用及代码示例

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

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

AppCompatActivity.unregisterReceiver介绍

暂无

代码示例

代码示例来源:origin: Rukey7/MvpApp

/**
 * Activity.onDestroy() 里调用
 *
 * @return 返回播放进度
 */
public int onDestroy() {
  // 记录播放进度
  int curPosition = mVideoView.getCurrentPosition();
  mVideoView.destroy();
  IjkMediaPlayer.native_profileEnd();
  if (mDanmakuView != null) {
    // don't forget release!
    mDanmakuView.release();
    mDanmakuView = null;
  }
  if (mShareDialog != null) {
    mShareDialog.dismiss();
    mShareDialog = null;
  }
  mHandler.removeMessages(MSG_TRY_RELOAD);
  mHandler.removeMessages(MSG_UPDATE_SEEK);
  // 注销广播
  mAttachActivity.unregisterReceiver(mBatteryReceiver);
  mAttachActivity.unregisterReceiver(mScreenReceiver);
  mAttachActivity.unregisterReceiver(mNetReceiver);
  // 关闭屏幕常亮
  mAttachActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  return curPosition;
}

代码示例来源:origin: Rukey7/IjkPlayerView

/**
 * Activity.onDestroy() 里调用
 *
 * @return 返回播放进度
 */
public int onDestroy() {
  // 记录播放进度
  int curPosition = mVideoView.getCurrentPosition();
  mVideoView.destroy();
  IjkMediaPlayer.native_profileEnd();
  if (mDanmakuView != null) {
    // don't forget release!
    mDanmakuView.release();
    mDanmakuView = null;
  }
  if (mShareDialog != null) {
    mShareDialog.dismiss();
    mShareDialog = null;
  }
  mHandler.removeMessages(MSG_TRY_RELOAD);
  mHandler.removeMessages(MSG_UPDATE_SEEK);
  // 注销广播
  mAttachActivity.unregisterReceiver(mBatteryReceiver);
  mAttachActivity.unregisterReceiver(mScreenReceiver);
  mAttachActivity.unregisterReceiver(mNetReceiver);
  // 关闭屏幕常亮
  mAttachActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  return curPosition;
}

相关文章

微信公众号

最新文章

更多

AppCompatActivity类方法