Activity life cycle onStop: Can I save all my databse table updates in onStop () of activity? If not explain why and also explain where should I save db tabl es?

In case of low memory or configuration changes, there is a chance that android may force-kill your application before reaching onStop(). onPause() is the only function that will be called with out fail before killing the application. so save all persistent data like DB tables in onPause() only.
Note : We can't save all database tables in onSaveInstanceState, because that function will not be called if user presses back button.

No comments:

Post a Comment