public static SharedPreferenceUtils initWith ( Context context , String name ) { if ( sharedPreferenceUtils == null ) { sharedPreferenceUtils = new SharedPreferenceUtils ( ) ; } if ( isEmptyString ( name ) ) { sharedPreferenceUtils . sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( context ) ; } else { sharedPreferenceUtils . sharedPreferences = context . getSharedPreferences ( name , Context . MODE_PRIVATE ) ; } return sharedPreferenceUtils ; }
Init SharedPreferences with context and a SharedPreferences name