Example #1
0
 /**
  * Called by onResume or surfaceCreated. An actual resume should be done only when the surface is
  * ready. Note: Some Android variants may send multiple surfaceChanged events, so we don't need to
  * resume every time we get one of those events, only if it comes after surfaceDestroyed
  */
 public static void handleResume() {
   if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) {
     SDLActivity.mIsPaused = false;
     SDLActivity.nativeResume();
     mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
   }
 }
Example #2
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);
   }
 }