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
  • 6,115
  • 16
  • 50
  • 57
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281

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
  • 38,516
  • 9
  • 41
  • 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