开发者

Store in sharedPreferences

I have some things in my app that I need to store, in order to have it available the next time I open the appl开发者_StackOverflowication. I wonder if I could save them using the sharedPreferences mechanism even if I don't have any "view" associated with them ! .If this is possible please let me know, if not, what would you suggest instead ?


All you need is a component that can furnish you a handle to the android.os.Context An Activity is such a component. SharedPreference's data is stored in a file - somewhat akin to a properties file (key,value pair).

You can also create your own files and store it in the app's private directory.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜