Skip to content

Instantly share code, notes, and snippets.

@jezinka
Created Apr 16, 2017
Embed
What would you like to do?
public static int getTimeDeltaMilliseconds(Context context) {
return 1000 * 60 * 60 * 24 * getDaysInPlanner(context);
}
public static int getDaysInPlanner(Context context) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
String daysNoPrefs = sharedPref.getString(SettingsActivity.PREFS_DAYS_NO, "7");
return Integer.parseInt(daysNoPrefs);
}
private static int getFirstDay(Context context) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
String firstDayPrefs = sharedPref.getString(SettingsActivity.PREFS_FIRST_DAY, "7");
return Integer.parseInt(firstDayPrefs);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment