public static void putBoolean(String key, boolean value) { BuyMilkApp.getContext() .getSharedPreferences(KEY_PREFS_NAME, Context.MODE_PRIVATE) .edit() .putBoolean(key, value) .apply(); }
public NotificationService() { super(NotificationService.class.getSimpleName()); mContext = BuyMilkApp.getContext(); mAlarmManager = (AlarmManager) mContext.getSystemService(ALARM_SERVICE); }
public static boolean getBoolean(String key, boolean defaultValue) { return BuyMilkApp.getContext() .getSharedPreferences(KEY_PREFS_NAME, Context.MODE_PRIVATE) .getBoolean(key, defaultValue); }
public static int getInt(String key, int defaultValue) { return BuyMilkApp.getContext() .getSharedPreferences(KEY_PREFS_NAME, Context.MODE_PRIVATE) .getInt(key, defaultValue); }
private static class RemindDatabaseInstanceHolder { private static final RemindDatabase INSTANCE = new RemindDatabase(BuyMilkApp.getContext()); }