コード例 #1
0
ファイル: SDLActivity.java プロジェクト: fcjailybo/asgp
 /**
  * Called by onPause or surfaceDestroyed. Even if surfaceDestroyed is the first to be called,
  * mIsSurfaceReady should still be set to 'true' during the call to onPause (in a usual scenario).
  */
 public static void handlePause() {
   if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) {
     SDLActivity.mIsPaused = true;
     SDLActivity.nativePause();
     mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false);
   }
 }
コード例 #2
0
ファイル: SDLActivity.java プロジェクト: ThunderBeast/Mongrel
 // Called when we lose the surface
 @Override
 public void surfaceDestroyed(SurfaceHolder holder) {
   Log.v("SDL", "surfaceDestroyed()");
   if (!SDLActivity.mIsPaused) {
     SDLActivity.mIsPaused = true;
     SDLActivity.nativePause();
   }
   enableSensor(Sensor.TYPE_ACCELEROMETER, false);
 }