You can use the AlarmManager.  Be very careful, though, you can easily make
your widget a big battery hog.

On Sun, Jul 5, 2009 at 2:14 PM, String <[email protected]>wrote:

>
> I'm trying to build a custom clock AppWidget, one that I can't base
> off of the standard AnalogClock or DigitalClock. I'm doing my best to
> keep its updates lightweight, but nonetheless, it needs to update once
> a minute. The TIME_TICK broadcast action seems the obvious way to go
> about it - but as the docs state, "You can not receive this through
> components declared in manifests, only by exlicitly registering for it
> with Context.registerReceiver()." Problem is, I can't use
> Context.registerReceiver() in the AppWidget, because  it's a
> BroadcastReceiver itself.
>
> Anyone have an idea how I might get TIME_TICK in an AppWidget, or
> another way to get an update each minute? I considered the
> updatePeriodMillis attribute in the provider XML, but that won't let
> me sync the update to the minute-changeover, it would only trigger an
> update at some time during the minute.
>
> Any tips would be appreciated. Thanks!
>
> String
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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