Android: Added a new method in SDLSurface.

This commit is contained in:
Philipp Wiesemann 2015-10-07 21:16:40 +02:00
parent 86711041f2
commit 5bc93cc5c6
1 changed files with 5 additions and 1 deletions

View File

@ -300,7 +300,7 @@ public class SDLActivity extends Activity {
if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) {
SDLActivity.mIsPaused = true;
SDLActivity.nativePause();
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false);
mSurface.handlePause();
}
}
@ -999,6 +999,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
mHeight = 1.0f;
}
public void handlePause() {
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}
public void handleResume() {
setFocusable(true);
setFocusableInTouchMode(true);