2

Is there a way to prevent android from recreating the last opened activity after the app process was killed (due to saving memory usage, when app is in background for some time) ? When the process is killed and app is re-created I need to start from the mainActivity, not the last one.

Note that: I don't want to kill history every time I press HOME button. Just when the process is killed.

T.Vert
  • 279
  • 2
  • 13

1 Answers1

1

You will need to manage this yourself. There is no way to do this using flags or whatever, since you only want the app started from scratch if the task was killed. I've detailed instructions for how to do this in the following answer:

https://stackoverflow.com/a/27276077/769265

David Wasser
  • 93,459
  • 16
  • 209
  • 274
  • yeah, I also ended up using this workaround. I was only hoping there would be a more nice and built-in solution. Android is so weird... Thanks anyway :) – T.Vert Dec 21 '17 at 07:42