Activity OnDestroy never called?

onDestroy() is called only when system is low on resources(memory, cpu time and so on) and makes a decision to kill your activity/application or when somebody calls finish() on your activity. So, to test your code() you can make a test button, that will call finish() on your activity. Read more here. Also, I believe … Read more

What is Activity.finish() method doing exactly?

When calling finish() on an activity, the method onDestroy() is executed. This method can do things like: Dismiss any dialogs the activity was managing. Close any cursors the activity was managing. Close any open search dialog Also, onDestroy() isn’t a destructor. It doesn’t actually destroy the object. It’s just a method that’s called based on … Read more