I am currently working on a ReactNative + Android application. Now, I have an issue where foregrounding my application, via the app icon/launcher, closes the previously displayed screen & destroys the previous activity. Ideally, the screen & activity should remain / resume when clicking the launcher (just like it does when foregrounding via recently opened tasks).
I have been looking @ launchModes
in my manifest, but removing all launchModes
on all activities (except the root activity) does not resolve my issue (as per this similar stack post: Click on app icon destroys activities). I have also changed the launchMode
on the root activity from singleTask
to singleTop
; and this seemed to fix things @ first, but broke the app when launching via deep linking (pushed multiple activities .. etc).
I am currently doing some more research into launch modes & activities, but am not sure how to tackle the issue beyond that.
My AndroidManifest looks like this:
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:label="@string/app_name"
android:theme="@style/SplashTheme">
Any insight would be greatly appreciated, thanks.