Browse Source

fixed crash due to orientation change or call of onDestroy()

Martin Felis 12 years ago
parent
commit
eaf4e6d8b2
2 changed files with 7 additions and 1 deletions
  1. 1 1
      AndroidManifest.xml
  2. 6 0
      src/org/libsdl/app/SDLActivity.java

+ 1 - 1
AndroidManifest.xml

@@ -11,7 +11,7 @@
                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
         <activity android:name="GameActivity"
                   android:label="Löve for Android"
-                  android:screenOrientation="landscape">
+                  android:screenOrientation="unspecified">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />

+ 6 - 0
src/org/libsdl/app/SDLActivity.java

@@ -109,6 +109,12 @@ public class SDLActivity extends Activity {
     protected void onDestroy() {
         super.onDestroy();
         Log.v("SDL", "onDestroy()");
+        
+        if (!isFinishing()) {
+            Log.v("SDL", "Not quitting native app as isFinishing() is false");
+        	return;
+        }
+        
         // Send a quit message to the application
         SDLActivity.nativeQuit();