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.
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
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.