Beispiel #1
0
 /**
  * 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);
   }
 }
Beispiel #2
0
 // 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);
 }