Example #1
0
 public static void setStateFilter(Context context, StateFilter newValue) {
   SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
   Editor editor = prefs.edit();
   editor.putString(PrefConstants.STATE_FILTER, newValue.toString());
   editor.commit();
 }
Example #2
0
 public static StateFilter getStateFilter(Context context) {
   SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
   return StateFilter.valueOf(
       prefs.getString(PrefConstants.STATE_FILTER, StateFilter.SOME.toString()));
 }