コード例 #1
0
 @Override
 protected void onPause() {
   mVideoView.pause();
   updateShareTVdatabase(mCurrentMovieDetail, mVideoView.getCurrentPosition());
   Log.d(TAG, "mVideoView.getCurrentPosition():" + mVideoView.getCurrentPosition());
   Log.d(TAG, "moveid:" + mCurrentMovieDetail.getData().getMovieId());
   super.onPause();
 }
コード例 #2
0
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   Log.i("jiangtao4", "activity keydown");
   if (keyCode == KeyEvent.KEYCODE_BACK) {
     Configuration config = getResources().getConfiguration();
     DisplayMetrics metrics = getResources().getDisplayMetrics();
     // if the screen orientation is landscape now
     if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
       // set it portait!!!
       setScreenOrientation(false, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
       return true;
     } else {
       updateShareTVdatabase(mCurrentMovieDetail, mVideoView.getCurrentPosition());
       return super.onKeyDown(keyCode, event);
     }
   }
   return super.onKeyDown(keyCode, event);
 }