0

Before my app begins i have few files which will be downloaded and then it will automatically start with splash screen and moves to next screen, now when the files are being downloaded the user clicks on home button so that app will download the files in background.

Now suppose the download is completed and automatically started with splash screen, and also now in the notification the user can see that the downlaod is complete and will click on that now what happens is again the app starts with splash screen, so there are 2 instances of activity how to avoid this?

Goofy
  • 6,098
  • 17
  • 90
  • 156

1 Answers1

1

In your manifest

<activity
        android:name=your splash screen name
        android:launchMode="singleInstance"
</activity>

When the user touch the notification, your current splash screen onNewIntent will be called. So if you want to change anything override onNewIntent.

Hoan Nguyen
  • 18,033
  • 3
  • 50
  • 54