Android上SharedPreference的操作步骤
1、得到SharedPreferences对象
2、调用SharedPreferences对象的edit()方法来获取一个SharedPreferences.Editor对象。
3、向SharedPreferences.Editor对象中添加数据。通过API:
editor.putInt/putString等。
4、调用commit方法将添加的数据提交。
1、得到SharedPreferences对象
2、调用SharedPreferences对象的edit()方法来获取一个SharedPreferences.Editor对象。
3、向SharedPreferences.Editor对象中添加数据。通过API:
editor.putInt/putString等。
4、调用commit方法将添加的数据提交。