android入门之: SharedPreferences
2015-09-04 11:37
399 查看
读取数据:
保存数据:
+++++++++++++++++++方法详解++++++++++++++++++++++++++++++
摘要:
Interface for accessing and modifying preference data returned by
保存数据:
+++++++++++++++++++方法详解++++++++++++++++++++++++++++++
SharedPreferences综述:
使用getSharedPreferences(String, int) 方法提供获取和修改preference的接口
对于任意指定的preferences集合, 所有的app共享同一个实例;
如果想要 修改preferces的话, 必须通过SharedPreferences.Editor对象; 该对象可以保证preference状态一致而且可以控制存储;他的各种get方法的返回对象必须在整个程序中是不可变的;
使用方法http://wear.techbrood.com/guide/topics/data/data-storage.html#pref
摘要:
Interface for accessing and modifying preference data returned by
getSharedPreferences(String, int). For any particular set of preferences, there is a single instance of this class that all clients share. Modifications to the preferences must go through an
SharedPreferences.Editorobject to ensure the preference values remain in a consistent state and control when they are committed to storage. Objects that are returned from the various
getmethods must be treated as immutable by the application.
相关文章推荐
- android安卓智能穿戴&仿苹果手表界面的源码效果
- 【Android】android studio ndk使用例子
- Android中Xfermode简单用法
- android expandablelistview 展开动画
- Android 自定义View
- android 时间格式及时间差问题
- Android开发拖动条SeekBar的使用
- Android Studio中res下创建layout-large文件夹无法显示问题
- android 进程间通信---Service Manager(1)
- Android之TabHost用法—定义Tab标签样式
- 工具篇——轻松使用Fiddler抓包(For Android)
- Android之TabHost用法详解
- android之VideoView和视频播放View的扩展
- Android Studio常用修改
- Android PopupWindow 的显示位置
- Android WakeLock使用方法
- Android实战简易教程-第五十一枪(ListView实现子控件的动态显示和隐藏、checkbox全选和反选)
- 【Android】2015.09.02 第一行代码 Day3 Count:5
- Android Studio 开篇
- Android - Fragment+ViewPager结合使用