set repeated reminder that repeats every month

1.1k views Asked by At

I am taking two dates from the user in my android code. I want to set reminder for every month which are in between those two dates. If first date is : 1st jan 2015 and other date is 1st Feb 2016 then I want to set reminder for the 1st day every month in between these two dates. I tried using alarm manager but couldnt able to repeat alarm. Please help. thank you

2

There are 2 answers

0
ProjectJourneyman On BEST ANSWER

One method might be to have your alarm receiver set the next alarm when it is called (e.g. it activates on 1 Jan 2015 and sets the next one for 1 Feb 2015), so you're always setting one ahead.

0
Ish On

First you'll need to create 2 Calendar objects to store the dates to store the dates set by the user. Then proceed by either creating pending intents for each date in a for loop by incrementing the value of month. Assign all the pending intents to your AlarmManager and fire them with FLAG_ONE_SHOT.

Please provide your code so we could better understand your problem.