Mark,
I found a pieces of codes in Android, as below:
//
com.android.server.BackupManagerService.startBackupAlarmsLocked(long)
mAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, when,
BACKUP_INTERVAL + random.nextInt(FUZZ_MILLIS),
mRunBackupIntent);
// where BACKUP_INTERVAL is declared as
private static final long BACKUP_INTERVAL =
AlarmManager.INTERVAL_HOUR;
So, I just wonder, why "7*INTERVAL_DAY" not work as weekly but daily?
Is "INTERVAL_DAY" the max interval can be set on "setRepeating()"?
On Oct 26, 2:12 pm, Mark Murphy <[email protected]> wrote:
> On Tue, Oct 26, 2010 at 2:06 AM, Tim <[email protected]> wrote:
> > Thanks Mark.
> > I am using "INTERVAL_DAY"with "setRepeating(...,long interval,...)".
>
> INTERVAL_DAY is used with setRepeatingInexact(). The value happens to
> be correct for use with setRepeating(), though.
>
> > Still, any workaround/solution for weekly alarm?
>
> If it is not working for you, then wake up every day and see if a week
> has passed. Or, use set() to schedule an alarm for a week from now,
> and have that alarm call set() to schedule another alarm a week in the
> future.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 2.2 Programming Books:http://commonsware.com/books
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en