Reputation: 27
i have created a dietchart arrayList with specific timeperiod, now i want to create a reminder which will notify when it is time for a specific diet with sound.
Upvotes: 0
Views: 71
Reputation: 446
Although this question is little bit old but it can still help to other users. You have to use alarm manager for triggering at specific time.
Intent intent = new Intent(this, MyService.class);
PendingIntent pintent = PendingIntent.getService(this, 0, intent, 0);
AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm.setRepeating(AlarmManager.RTC_WAKEUP,<here set time when you want to trigger>,<here you can set time to repeat after trigering continusosly>,pintent);
Upvotes: 1