Brian
Brian

Reputation: 5028

Using sharedPreferences to save application state

I was wondering about how saving variables work by using SharedPreferences inside onStop() function. I already managed to save and retrieve variables from a "file".

My question is: lets say i have x layouts in my app, and need to use different file names in my SharedPreferences. What happens with all these files when the app is uninstalled? Do we waste our memory all the time? Is there a point where all these files are getting deleted?

Upvotes: 0

Views: 274

Answers (1)

nEx.Software
nEx.Software

Reputation: 6862

SharedPreferences are deleted when the application is uninstalled.

Edit: For completeness, they'd also be deleted when one performs a "Clear data" operation from the Application Manager.

Upvotes: 3

Related Questions