4

Because our app users report some crashes due to restored activities, I would like to test this.

Is there any possibility to manually cause Android to destroy the running (background) activity to save space?

nob
  • 1,067
  • 1
  • 11
  • 18
  • Not sure what you mean with "destroy", but how about `finish();`? – bos Oct 30 '11 at 14:51
  • I just want to replicate android's behaviour (destroying background activities when too less memory is left) to *test* things. Not in general. – nob Oct 30 '11 at 17:19

2 Answers2

5

See the official Dev Tools app in the emulator, and if you get hold of a device running system level 4+, there's a system setting area labeled 'development' under which there's a checkbox for destroying activities as soon as they are paused.

larham1
  • 11,736
  • 5
  • 35
  • 26
0

Did you try clear the android stack of activities with FLAG_ACTIVITY_CLEAR_TOP?

Check this link

Community
  • 1
  • 1
Pedro Rainho
  • 4,234
  • 1
  • 19
  • 21