Sunday 1 December 2019

How to save application state on Android





Possible Duplicate:
How do I save an Android application's state?







I have an Android app. The app crashes in one screen and the app exits. When I launch the app again, I need to launch another screen by checking some condition in the initial activity onCreate() method. Can we do this using preferences or SQLite?


Answer



You must override the onSaveInstanceState method. You can use preferences or SQLite, too.



Here's your exact duplicate question with code samples.




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...