private static void createAlarm( AlarmManager alarmManager, PendingIntent birthdayNotifications, Context context) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); Pair<Integer, Integer> time = TimePreference.stringToValue( context, preferences.getString("time", context.getString(R.string.default_time))); Date now = new Date(System.currentTimeMillis()); now.setHours(time.first.intValue()); now.setMinutes(time.second.intValue()); alarmManager.setRepeating(RTC, now.getTime(), INTERVAL_DAY, birthdayNotifications); }