Don't use a service; use the alarm manager to schedule your wakeup/work.

On Sat, May 23, 2009 at 9:38 AM, Michael Elsdörfer
<[email protected]>wrote:

>
> I'm writing a widget that needs to update rather infrequently (say
> multiple hours). Following the source examples out there, it seems the
> common solution is to use a service to prepare the updates. However,
> after I am done, my process is still running on "service level", it
> looks like it's not being killed by Android in low memory conditions,
> and killing it manually causes it to restart.
>
> The same seems to be true for all other widgets I have installed so
> far - they stay in memory.
>
> Wouldn't it be better to have to service call this.stop() when it is
> done, at least if the widget knows it probably won't need to do
> another update any time soon?
>
> I'm doing this now, and it seem to work fine - my process is being
> killed when Android needs memory. I'm confused though as to why this
> wouldn't be the encouraged behaviour then (it's not like the G1 has an
> aweful lot of memory to spare). Should or shouldn't I be doing this?
> >
>


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