0

How can I terminate an app in the Android Emulator so that Activity's onDestroy is called? Stopping the process from the Devices window seems to be a process kill, not a graceful closing like the OS does.

Kara
  • 5,996
  • 16
  • 49
  • 56
Seva Alekseyev
  • 58,089
  • 23
  • 157
  • 265

1 Answers1

1

Just pressing the back button in the emulator should finish the activity and call onDestroy. That I suppose is the default behavior if you have not overridden it through onBackPressed.

Abhinav
  • 36,436
  • 9
  • 40
  • 49
  • Does not terminate the process, but kills the activity. Good for my purposes. – Seva Alekseyev Apr 16 '11 at 21:30
  • Yep. Android takes care of terminating the process. Huge discussion here: http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon/2034238#2034238 – Abhinav Apr 16 '11 at 21:32