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.
This commit is contained in:
Raul Rabadan Arroyo 2025-04-26 23:21:50 +02:00 committed by GitHub
parent 9cf1a1afa2
commit c4408a817b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,7 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:theme="@style/Theme.AppCompat.NoActionBar">
<meta-data
android:name="android.app.lib_name"

View File

@ -11,6 +11,7 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:theme="@style/Theme.AppCompat.NoActionBar">
<meta-data
android:name="android.app.lib_name"