skip to Main Content

Android Studio – AlarmManager fires too early

I have this code in my class: public void setAlarm(Context context) { AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, StepCountUpdaterAlarm.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); Long…

VIEW QUESTION
Back To Top
Search