3

When activity is restored after was being killed by the system (I mean app process was killed, and process restarts with old activities stack), activity restore old it's state - is it possible to clear this activity state and restart activity from from scratch.

pvllnspk
  • 5,667
  • 12
  • 59
  • 97

1 Answers1

0

Just check which method is called when your activity is killed...onDestroy() or onPause(), as most probably. When "killed" your activity is not actually destroyed, it is paused, hence onResume() is executed, as your state is preserved. To destroy the activity you can use finish() in your onPause() method, have a look at this post on how to do it.

Community
  • 1
  • 1
faizanjehangir
  • 2,771
  • 6
  • 45
  • 83