Will SharedPreference be destroyed if the Context has been destroyed?
Will SharedPreference be destroyed if the Context has been destroye开发者_StackOverflowd?
For example, if the Context is an Activity, and this Activity has quit.
I tried in my code, and the SharedPreference turns to be null, as well as the Context.
I also tried to find some clues in the opensource code, but it's complicated for me.
SharedPreferences are there to store data. So the data should still be here, even if you restart your phone for example. So to answer your question: No, SharedPreferences are not destroyed.
However, to solve your problem you have to post some code.
精彩评论