public static void setRepeatMode(Context context, RepeatMode repeatMode) { SharedPreferences prefs = getPreferences(context); SharedPreferences.Editor editor = prefs.edit(); editor.putString(Constants.PREFERENCES_KEY_REPEAT_MODE, repeatMode.name()); editor.commit(); }
public static RepeatMode getRepeatMode(Context context) { SharedPreferences prefs = getPreferences(context); return RepeatMode.valueOf( prefs.getString(Constants.PREFERENCES_KEY_REPEAT_MODE, RepeatMode.OFF.name())); }