Hi,
I have to repeat alarm for between 1 day to 60 days. For example, the user can be able to repeat alarm after every 5 days, 10 days or 60 days (maximum).
Option1 ( Implemented Code

-----------------------------
alarmmanager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+ (durationInDays * 24 * 3600 * 1000), (durationInDays * 24 * 3600 * 1000), pIntent);
Note: But it is working fine but it supports maximum 10 days(appx) repeating only after that "(durationInDays * 24 * 3600 * 1000)" it goes into -ve value so, I am unable to set maximum 60 days alarm repeatedly. AlarmManager class only supports a long value for choosing the interval between the execution of the pending intent.
Is there any other option to set repeat alarm for the no of days ?
Option 2 ( Implemented Code

:
-------------------------------
Date futureDate = new Date(new Date().getTime() + (86400000 * durationInDays));
Date dateInterval = new Date(86400000 * durationInDays);
am.setRepeating(AlarmManager.RTC_WAKEUP, futureDate.getTime(), dateInterval.getTime(), pendingIntent);
Note: We set repeating alarm maximum every 24 days but when i give (durationInDays = 25; // in Days) then it takes -ve values.
Can I set repeating alarm with the help of Calender?
Please help me by piece of code.
Thanks in Advance,
Andy