标签:
package org.mo.common.util.sharepreferences; import android.content.Context; import android.content.SharedPreferences; public class MySharePreferences { private Context mContext; private static MySharePreferences mySharePreferences; public MySharePreferences getInstance(Context mContext) { if (mySharePreferences == null) { mySharePreferences = new MySharePreferences(mContext); } return mySharePreferences; } private MySharePreferences(Context mContext) { super(); this.mContext = mContext; } public SharedPreferences getPrivateSharedpreferences(String name) { SharedPreferences sharedpreferences = getSharedpreferences(name, Context.MODE_PRIVATE); return sharedpreferences; } public SharedPreferences getSharedpreferences(String name, int model) { SharedPreferences sharedPreferences = mContext.getSharedPreferences( name, model); return sharedPreferences; } }
(android-002)关于shareprefences使用
标签:
原文地址:http://my.oschina.net/moziqi/blog/364867