Is ondestroy not always called?
I have put some cache cleaning code in onDestroy of my activity but most of the time the code is not executed unless I explicitly finish the activity via finish() . Edit: Just read onDestroy is called only with finish() or if the system is low on resources. So where do I need to put my cache cleaning code? If I put it in onPause() and the user goes back to the app, the cache is cleared. I am actually storing important temporary files in the cache that should not be deleted in onPause . From Android developer documentation : protected void onDestroy () Added in API level 1 Perform any final