Explorar el Código

Bug fix that prevented Android app to be relaunched successfully.
Also tweak the Android sample launcher app to go back from MainActivity to LauncherActivity before exiting completely
in order to make it easier to launch many sample apps in a same session.

Yao Wei Tjong 姚伟忠 hace 7 años
padre
commit
b238824f63

+ 3 - 1
Source/ThirdParty/SDL/src/core/android/SDL_android.c

@@ -718,8 +718,10 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeQuit)(
     // Urho3D: added log print
     __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeQuit()");
     // Urho3D: Free the memory that we allocate during init
-    if (mFilesDir)
+    if (mFilesDir) {
         free(mFilesDir);
+        mFilesDir = 0;
+    }
 
     /* Discard previous events. The user should have handled state storage
      * in SDL_APP_WILLENTERBACKGROUND. After nativeQuit() is called, no

+ 3 - 4
android/launcher-app/src/main/AndroidManifest.xml

@@ -8,12 +8,11 @@
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:roundIcon="@mipmap/ic_launcher_round"
-        android:supportsRtl="true"
-        android:theme="@style/AppTheme">
+        android:supportsRtl="true">
         <activity
             android:name=".LauncherActivity"
-            android:noHistory="true"
-            android:screenOrientation="portrait">
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />

+ 0 - 1
android/launcher-app/src/main/java/com/github/urho3d/launcher/LauncherActivity.kt

@@ -85,7 +85,6 @@ class LauncherActivity : ExpandableListActivity() {
                     )
             )
         }
-        finish()
         return true
     }