Reputation: 837
I have a really heinous bug that I'm trying to track down and I've got the following situation.
Here's my scenario, I launch an activity, I change screen orientation to landscape, I change it again back to portrait, then I click on the device back button. After I do that, onDestroy of my activity is never called. It's called when I change orientation, but not when the user hits the back key.
I'm at my wits end here and i'm looking for ideas on what could prevent the system from calling onDestroy...
Upvotes: 0
Views: 888
Reputation: 947
Android docs state
Note: do not count on this method being called as a place for saving data! For example, if an
activity is editing data in a content provider, those edits should be committed in either onPause() or
onSaveInstanceState(Bundle), not here.
If you also look at the Killable column in the activity life cycle, the application can be killed by the system at any point after onPause on pre-honeycomb systems for whatever reason.
Upvotes: 2