0

I have a PendingIntent set as the contentIntent inside of a foreground notification and this PendingIntent should launch the last running activity with singleTop so that another instance of the activity is not created.

The issue I am having is that when Don't keep Activities is set in the developer options a duplicate activity is created at the top of the stack (A,B,C,C) where I would like (A,B,C) where C is the last running activity.

I know it is duplicated because when I use the back button I see two identical activities before reaching my previous activities.

HaydenKai
  • 871
  • 7
  • 31
  • How are you determining that there are multiple instances as you say? It would help if you discuss why you want to do this. Launch modes are much more complicated then they appear at first and have all manner of caveats and quirky behavior. You are better off using the default launch mode if at all possible. – Jeffrey Blattman Apr 30 '18 at 18:50
  • Have you read what `Don't keep activities` is? https://stackoverflow.com/questions/22400859/dont-keep-activities-what-is-it-for – Saba Apr 30 '18 at 19:38

0 Answers0