Thursday, June 10, 2010

[android-developers] Re: Service gets killed (due to activity ?)

If you have a very good reason for doing so (one that you're willing
to defend to users and the likes of Mark) then you can force the
service to have the same priority as an activity use setForeground.
The caveat is that you must keep a notification visible for your
service.

On Jun 10, 11:00 am, Tejas <tej...@gmail.com> wrote:
> Hi,
>
> I have a service running in the background. It starts on device boot.
> Also, I have one activity (that appears in the task launcher) in which
> I have provided buttons to start and stop the service.
>
> Now, I install the application on the phone and I start the service
> using this activity (and not on-device boot). As expected the service
> starts and starts doing its designated task. I no-longer need the
> activity. So it goes out of sight and may not be required for a long
> time now.
>
> My question is, now, if the android platform kills this activity, will
> it kill my service too ? (This is because I see that after few hours,
> my service is not running anymore.). If this is true, then will the
> service continue running longer if the service was started on device
> boot.
>
> Regards,
> Tejas

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