I am creating an emergency application. I have successfully implemented the basic alarm functions.
Calendar calendar = Calendar.getInstance(); calendar.set(calendar.HOUR_OF_DAY, sHour); calendar.set(calendar.MINUTE, sMin); calendar.set(calendar.SECOND, 0); calendar.set(calendar.MILLISECOND, 0); long sdl = calendar.getTimeInMillis(); Intent intent = new Intent(AlarmList.this, AlarmReceiver.class); PendingIntent sender = PendingIntent.getBroadcast(AlarmList.this, 0, intent,PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager ALARM1 = (AlarmManager)getSystemService(ALARM_SERVICE); ALARM1.set(AlarmManager.RTC_WAKEUP, sdl, sender);
in my application, the user can select the days (Sunday, Monday ...) to repeat the alarm weekly. I am trying to create some alarms to repeat weekly, but donβt know how to do it. can I create it using (repeat) the interval or create multiple alarm dispatchers?
android alarmmanager
Hassy31 Dec 12 2018-11-12T00: 00Z
source share