I assume you are saying you are using registerReceiver() instead of publishing a receiving in a manifest? If so, this isn't really going to be all that more efficient (especially next to everything else going on), and more importantly is not correct because it means your widget can only get broadcasts while your code is running.
On Mon, May 4, 2009 at 7:52 AM, Alea <[email protected]> wrote: > > Hi! > > I started to implement my own App Widget using the example provided in > the ApiDemos. In order to update the Widget efficiently I chose the > BroadcastReceiver mechanism. In the ApiDemos there is this > ExampleBroadcastReceiver which would (or should) react to changes > related to TimeZone and Time as specified in the AndroidManifest of > the ApiDemos. > > I have debugged this Example using Eclipse and the Logcat output > (provoking changes in TimeZone through the settings) and come to the > conclusion that there must be some bug in the app widget framework. > The only BroadcastReceiver that seems to work is the AppWidgetProvider > itself. > > For instance I would expect something like: D/ExampleBroadcastReceiver > intent=XY in the logcat's output after I have provoked the event XY. > > I have even tried without the 'enabled' option in the receiver's > specification in the AndroidManifest. > > BroadcastReceivers are needed to keep the update rate of my > AppWidgetProvider low and to be battery friendly. As for now my own > AppWidget Implementation that I have written has an update rate of 10 > minutes which I could change to once a day if I could use the > BroadcastReceiver mechanism. > > Hopefully this useful feature can be enabled somehow. Is anyone else > aware of this problem? Or maybe is there even a solution to this issue > I am experiencing? Do I have to enable the BroadcastReceiver by code > and not via the xml? > > Cheers, > > a desperate AppWidget developer > > .....By the way there are some copy&paste errors in the > ExampleAppWidgetProvider: onEnabled / onDisabled; comment and code > (eg. PackageManager.COMPONENT_ENABLED_STATE_ENABLED). > > > > -- 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 -~----------~----~----~----~------~----~------~--~---

