how to implement Persistent storage in android [duplicate]

泄露秘密 提交于 2019-12-24 11:40:19

问题


Possible Duplicate:
Persistent Data Storage in Android Development

I want to implement persistent storage in my application to store the UserName, when the user selects "Remember me" Checkbox. Can anybody guide me for this?


回答1:


You have to use shared preferences for this purpose. Shared preferences store information until the app gets uninstalled. This blog post gives an example.




回答2:


There is a very interesting and official article about that on the Android's website. I suggest starting by reading it.

This article will show you the various storage options and their intended usage. And for each option, it gives you some example code.

The external storage is of course covered by this article.



来源:https://stackoverflow.com/questions/7362093/how-to-implement-persistent-storage-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!