The Android Developers site has a Weather List Widget sample app:
http://developer.android.com/resources/samples/WeatherListWidget/index.html
One of the classes in it is WeatherWidgetProvider, which is an
AppWidgetProvider. This AppWidgetProvider is registering a
ContentObserver in onEnabled(),
The data observer lifespan isn't tied to the receiver, it's a static.
Also note that collection based widgets use other components, such as the
remote views factory, and the service which acts as a factory for said
factory (!).
This service is implemented by the framework as sticky, what you
On Thu, May 17, 2012 at 10:38 AM, Kostya Vasilyev kmans...@gmail.com wrote:
The data observer lifespan isn't tied to the receiver, it's a static.
It still goes away when the process does. Since it is only set up in
onEnabled(), that means that once the process dies the first time, the
observer
Besides, this observer monitors data published by a content provider that
lives within the same process (if I'm understanding the structure
correctly).
So if there are changes, it means they were pushed by the content provider,
which in turn means the process was alive.
However, I believe it's
On Thu, May 17, 2012 at 10:48 AM, Kostya Vasilyev kmans...@gmail.com wrote:
However, I believe it's still wrong, as I see no reason for the widget
provider's onEnabled to be called each time the process is recreated (such
as by an alarm or the sticky remote views service). Unless, that is, I'm
17.05.2012 18:55, Mark Murphy написал:
I'd just push the app
widget updates when updating the content provider and be done with the
matter.
I prefer using a worker thread wrapped in a service. The latter helps on
devices with too little memory.
All things said, a sample is just a sample.
6 matches
Mail list logo