Monday, March 21, 2011

[android-developers] Re: Restart Service after it has been killed by the system

Hi TreKing,
for "short time" I mean at least 30min, not more.

Using START_STICKY my service doesn't restart anymore. It has happened
to start again only once, but after 6 hours more or less... I'd like
to understand if this is the normal behaviour or there is something
wrong.


On 19 Mar, 02:55, TreKing <treking...@gmail.com> wrote:
> On Fri, Mar 18, 2011 at 6:02 AM, Paolo <brand...@gmail.com> wrote:
> > How can avoid it?
>
> You can't.
>
> > Or at least how can I restart my service as soon as possible?
>
> Attach it to an ongoing notification to indicate it's something the user
> cares about and should have slightly higher priority.
>
> > I found that can return from onStartCommand START_REDELIVER_INTENT
> > or START_STIKY. They seem to be what I'm looking for, but the Service seems
> > not to restart in a short time...
>
> Define "in a short time".
>
> > Could someone get me some suggestions or clarify it to me this situation?
> > Is there a trick?
>
> Not really. It should just work this way by default.
>
> --------------------------------------------------------------------------- ----------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment