@@ -0,0 +1,1951 @@
+%0Apackage com.jun.common.util;%0A%0Aimport android.content.Context;%0Aimport android.content.SharedPreferences;%0A%0A/**%0A * Created by Jun on 2016/5/3.%0A * %E6%8F%8F%E8%BF%B0%EF%BC%9A%E4%BF%9D%E5%AD%98%E5%88%B0 SharedPreferences %E7%9A%84%E6%95%B0%E6%8D%AE%0A *%0A * @author Jun%0A * @version v0.1.4%0A */%0Apublic class SharePreferencesUtil %7B%0A%0A    private static final String TAG = %22SharePreferencesHelper%22;%0A%0A    private SharedPreferences mPreferences;%0A%0A    private SharedPreferences.Editor mEditor;%0A%0A    private static SharePreferencesUtil mSPHelper;%0A%0A    public static SharePreferencesUtil getInstance(Context context) %7B%0A        if (mSPHelper == null)%0A            mSPHelper = new SharePreferencesUtil(context);%0A%0A        return mSPHelper;%0A    %7D%0A%0A    public SharePreferencesUtil(Context context) %7B%0A        mPreferences = context.getSharedPreferences(TAG, Context.MODE_APPEND);%0A    %7D%0A%0A    public boolean putString(String key, String value) %7B%0A        mEditor = mPreferences.edit();%0A        mEditor.putString(key, value);%0A        return mEditor.commit();%0A    %7D%0A%0A    public String getString(String key) %7B%0A        return mPreferences.getString(key, %22%22);%0A    %7D%0A%0A    public String getString(String key, String defValue) %7B%0A        return mPreferences.getString(key, defValue);%0A    %7D%0A%0A    public boolean putInt(String key, int value) %7B%0A        mEditor = mPreferences.edit();%0A        mEditor.putInt(key, value);%0A        return mEditor.commit();%0A    %7D%0A%0A    public int getInt(String key) %7B%0A        return mPreferences.getInt(key, 0);%0A    %7D%0A%0A    public int getInt(String key, int defValue) %7B%0A        return mPreferences.getInt(key, defValue);%0A    %7D%0A%0A    public boolean putBoolean(String key, boolean value) %7B%0A        mEditor = mPreferences.edit();%0A        mEditor.putBoolean(key, value);%0A        return mEditor.commit();%0A    %7D%0A%0A    public boolean getBoolean(String key) %7B%0A        return mPreferences.getBoolean(key, false);%0A    %7D%0A%0A    public boolean getBoolean(String key, boolean defVaule) %7B%0A        return mPreferences.getBoolean(key, defVaule);%0A    %7D%0A%0A%7D%0A

Add save data to SharePreferences util class