Skip to content

Commit c4408a8

Browse files
Make the example android app explicitly handle some device config change events to avoid getting the activity destroyed (#18839)
# Objective Fixes #18316 ## Solution Add android:configChanges="orientation|screenSize" to the AndroidManifest.xml as indicated in https://stackoverflow.com/a/3329486 to avoid the GameActivity from getting destroyed, making the app stuck/crash. ## Testing I checked the results in my phone and after adding the config change the issue went away. The change is relatively trivial, so there shouldn't be the need to make a lot more testing.
1 parent 9cf1a1a commit c4408a8

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

examples/mobile/android_example/app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<activity
1212
android:name=".MainActivity"
1313
android:exported="true"
14+
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
1415
android:theme="@style/Theme.AppCompat.NoActionBar">
1516
<meta-data
1617
android:name="android.app.lib_name"

examples/mobile/android_example_native/app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<activity
1212
android:name=".MainActivity"
1313
android:exported="true"
14+
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
1415
android:theme="@style/Theme.AppCompat.NoActionBar">
1516
<meta-data
1617
android:name="android.app.lib_name"

0 commit comments

Comments
 (0)