3

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.

vma_93
  • 153
  • 7
  • Did you try to remove all launchmode attributes? – Mertcan Özdemir May 13 '20 at 00:17
  • @MertcanÖzdemir Yes, I even removed from the Main Activity and let the launch mode default to 'standard'; but, this results in undesired behavior such as multiple screens and activity instances when deep linking – vma_93 May 13 '20 at 04:02

0 Answers0