Back to project page android-mvc-framework.
The source code is released under:
Apache License
If you think the Android project android-mvc-framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android_mvc.framework.db.dao; // ww w. ja v a 2s . co m import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; /** * ????????????????????????DAO????????????????????? * @author id:language_and_engineering * */ public class BasePrefDAO { protected static SharedPreferences.Editor mEditor = null; protected static SharedPreferences mSettings = null; /** * editor????? */ protected static SharedPreferences.Editor getEditor(Context context) { if( mEditor != null) { return mEditor; } mEditor = getSettings(context).edit(); return mEditor; } /** * Preferences????? */ protected static SharedPreferences getSettings(Context context) { if( mSettings != null) { return mSettings; } mSettings = PreferenceManager.getDefaultSharedPreferences(context); return mSettings; } }