示例#1
0
 public static void putBoolean(String key, boolean value) {
   BuyMilkApp.getContext()
       .getSharedPreferences(KEY_PREFS_NAME, Context.MODE_PRIVATE)
       .edit()
       .putBoolean(key, value)
       .apply();
 }
示例#2
0
  public NotificationService() {
    super(NotificationService.class.getSimpleName());

    mContext = BuyMilkApp.getContext();
    mAlarmManager = (AlarmManager) mContext.getSystemService(ALARM_SERVICE);
  }
示例#3
0
 public static boolean getBoolean(String key, boolean defaultValue) {
   return BuyMilkApp.getContext()
       .getSharedPreferences(KEY_PREFS_NAME, Context.MODE_PRIVATE)
       .getBoolean(key, defaultValue);
 }
示例#4
0
 public static int getInt(String key, int defaultValue) {
   return BuyMilkApp.getContext()
       .getSharedPreferences(KEY_PREFS_NAME, Context.MODE_PRIVATE)
       .getInt(key, defaultValue);
 }
示例#5
0
 private static class RemindDatabaseInstanceHolder {
   private static final RemindDatabase INSTANCE = new RemindDatabase(BuyMilkApp.getContext());
 }