问题
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