On Fri, Jul 15, 2011 at 3:32 PM, cathal coffey <[email protected]> wrote:
> What I want is a Timer/Alarm that initially fires every second for 60
> seconds

Ick.

> after that it should only fire every minute for 60 minutes
> after that it should only fire every hour for 24 hours
> after this it should simply read "Updated ages ago"
>
> Can someone help me with this? Initially I tried to use a Timer to
> accomplish this, it worked great accept for the over lapping effect I
> explained above.

Timer will not work. Once Android terminates your process for having
no running components, the Timer thread will go away.

> I am now trying to use an AlarmManager but I don't
> know how to pass it a reference to my AppWidget instance.

Put the instance ID in an extra in the Intent you wrap in the
PendingIntent. Or, if there should only be one app widget (or all
instances should be the same), you don't need to pass any reference --
just use the updateAppWidget() that updates all for your
ComponentName.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

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