fix: Retain task state for MainActivity and ComposeActivity (#1055)

Some users report that returning to the `ComposeActivity` loses content
they've entered and returns to `MainActivity`. I can't reproduce this,
but it's possible that Android is clearing the task state and returning
to the root activity (`MainActivity` in this case).

Set `alwaysRetainTaskState` to true to keep the activity stack, and
hopefully prevent this from happening.
This commit is contained in:
Nik Clayton 2024-10-27 12:38:34 +01:00 committed by GitHub
parent 24e0c16b3f
commit 8c28318474
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,7 @@
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize"
android:alwaysRetainTaskState="true"
android:exported="true"
android:theme="@style/SplashTheme">
@ -114,7 +115,8 @@
<activity
android:name=".components.compose.ComposeActivity"
android:theme="@style/AppDialogActivityTheme"
android:windowSoftInputMode="stateVisible|adjustResize" />
android:windowSoftInputMode="stateVisible|adjustResize"
android:alwaysRetainTaskState="true" />
<activity
android:name=".components.viewthread.ViewThreadActivity"
android:configChanges="orientation|screenSize" />