On Fri, Jun 18, 2010 at 4:32 PM, mike <[email protected]> wrote:
>> You should not be attempting to keep an AppWidgetProvider's data in
>> RAM, for the reasons you have discovered -- these objects have very
>> short lifespans. If you have state you need to maintain, use a
>> database or file.
>
> This is just standard Java stuff, right?

What is "this"?

> There's nothing odd or
> magical about static in android, right?

No, but processes come and go a bit more frequently than people might
be used to, if they are used to thinking of monolithic Java apps.

AppWidgetProvider is a manifest-registered BroadcastReceiver. These
objects live long enough for onReceive() to be processed. After that,
the process may be recycled or terminated, either of which will nuke
your statics. Hence, do not rely on static data members in
AppWidgetProviders.

-- 
Mark Murphy
CommonsWare
[email protected]
http://commonsware.com

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