Skip to content

Commit

Permalink
fix: Retain task state for MainActivity and ComposeActivity (#1055)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikclayton authored Oct 27, 2024
1 parent 24e0c16 commit 8c28318
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand Down Expand Up @@ -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" />
Expand Down

0 comments on commit 8c28318

Please sign in to comment.