Frank
Frank

Reputation: 71

How to save state of my android app after closing?

I've been working on an app lately and didnt figure out how to save the state of my application after closing ,i found something about SharedPreferences but i saw that it saves a (key,value) ,it can help if i want to store the username and the password but how to store the whole state of the app ?

Thanks.

Upvotes: 0

Views: 3268

Answers (1)

Kyle
Kyle

Reputation: 618

Please see here. It has exactly what you need. Just override onSaveInstanceState and save whatever custom values you may have to the bundle, and retrieve it by overriding onRestoreInstanceState.

Upvotes: 1

Related Questions