0

see my code: I am trying to repeat my alarm on the user request, but it doesn't work, give me advice please

if (calendar.before(Calendar.getInstance())) { //if alarm set in the past, increase one day calendar.add(Calendar.DATE, 1); } if (day_of_week != 0) { calendar.set(Calendar.HOUR_OF_DAY, timepicker.getCurrentHour()); calendar.set(Calendar.MINUTE, timepicker.getCurrentMinute()); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.DAY_OF_WEEK, day_of_week); pending_intent = PendingIntent.getBroadcast(this, 1, my_intent, PendingIntent.FLAG_UPDATE_CURRENT); alarm_manager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 24 * 60 * 60 * 1000, pending_intent); } else { pending_intent = PendingIntent.getBroadcast(this, 0, my_intent, PendingIntent.FLAG_UPDATE_CURRENT); alarm_manager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pending_intent); } //got to AlarmListView App_intent.app_intent(Add_Alarm_Activity.this, AlarmListView.class);

25th Dec 2017, 7:03 PM
John
2 Answers
+ 2
It would be better if you just wrote on playground
25th Dec 2017, 7:04 PM
᠌᠌Code X
᠌᠌Code X - avatar
0
Done
25th Dec 2017, 7:17 PM
John