Android opener app from Playstore vs Launcher

I noticed that if I open some apps installed on my phone using the Google Play Open Now button, the app will open as usual, if I go to another action inside the app, then press Home, then go to the launcher. open the app. I believe this will start a new task because the application launch activity reappeared. If I go back again, then I go to the second activity - this is the last activity in the foreground when I launched the app from Google Play. Is there a way to avoid this? I expect to see a second activity in this scenario. I want the same task whether my program is launched from the Launcher store or Google Play.

I found out that many apps in Playstore have this behavior. A good example is the Zomato app and for reference my app Shake Eat Off

I experimented with android:launchMode

in the manifest with no luck.

I tried to set singleTask

to root activity and `singleTop to second activity

I also tried adding android:alwaysRetainTaskState="true"

to root activity.

I have also tried setting singleTask

on root activity and singleInstance

on second activity

So to explain the chain more:

Google Play app page -> Open Now -> Root Activity -> Second Activity (now in foreground). Click home, click the app icon. At this point, the Root Activity feature is now active (but I expect to see a second activity because it is the last activity in the foreground). Tap Back → The second activity will resume.

+3


source to share





All Articles