Hi,

I want to start a service for example every hour. I implement an
AlarmManager:

AlarmManager mgr
=(AlarmManager)Main.this.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(this.getApplicationContext(),
UpdateWidgetService.class);
PendingIntent pi =
PendingIntent.getService(this.getApplicationContext(), 0, i,
Intent.FLAG_ACTIVITY_NEW_TASK);
mgr.cancel(pi);
mgr.setRepeating(AlarmManager.RTC, System.currentTimeMillis(),
Integer.parseInt(listUpdate.getValue())*3600000, pi);


So I cancel the manager which was startet before and then create a new
one.

I thought the parameter "RTC" ensures that the Alarm not beeing fired
when the device is in sleep mode (i turned the display off and the
device was 1 hour not turned on)... But nevertheless the service is
started...

So what am I doing wrong? Thanks

-- 
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

Reply via email to