From 6d4e677711a193bd048ad36acb0b9539f97ced82 Mon Sep 17 00:00:00 2001 From: "rolzad73@gmail.com" Date: Sun, 19 Aug 2012 16:19:56 +0000 Subject: [PATCH] * Stopped Android version from completely destroying/recreating SDLActivity when the device is locked. Fixes multiple identical issue entries in tracker: issue 696 (was marked fixed then restarted) issue 876, issue 886, issue 894 --- projects/mtg/Android/AndroidManifest.xml | 4 ++-- projects/mtg/Android/src/org/libsdl/app/SDLActivity.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/mtg/Android/AndroidManifest.xml b/projects/mtg/Android/AndroidManifest.xml index 28a47b5a3..96760060d 100644 --- a/projects/mtg/Android/AndroidManifest.xml +++ b/projects/mtg/Android/AndroidManifest.xml @@ -5,14 +5,14 @@ - + - + diff --git a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java index e9eb6b87e..e981d796e 100644 --- a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java +++ b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; import android.content.pm.PackageManager.NameNotFoundException; +import android.content.res.Configuration; import android.graphics.Canvas; import android.graphics.PixelFormat; import android.hardware.Sensor; @@ -788,6 +789,13 @@ public class SDLActivity extends Activity implements OnKeyListener{ } return "0" + v; } + + // Empty onConfigurationChanged to stop the Activity from destroying/recreating on screen off + @Override + public void onConfigurationChanged(Configuration newConfig) + { + super.onConfigurationChanged(newConfig); + } } /**