开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜