Thank you for your answers.

That's what I do:

http://paste.pocoo.org/show/83036/

I've just shortened it up a bit. With the binded service I'm calling a
method which is waiting for a location update. I'm registering the
LocationManager from the onStart() method of the service. (thats why I
need the startService(..) ) When the location listener gets called the
above mentioned method stops waiting and does its work and returns the
result to the activity. This is working pretty fine but now I'm not
pretty sure what happens (regarding the opening of new threads) when I
start/bind my service. From my point of view and what I've seen in the
DDMS just the one "background" thread gets added to the thread list
which I don't really understand. (I thought that starting a service
leads to a new thread in which the service runs)

I would be happy if someone could explain what really happens. :-)

Regards!

On 22 Aug., 18:28, "Justin (Google Employee)" <[EMAIL PROTECTED]> wrote:
> My bad, stop() is final, so you'll have to find another place to
> unbind the service.
>
> Cheers,
> Justin
> Android Team @ Google
>
> On Aug 22, 9:26 am, "Justin (Google Employee)" <[EMAIL PROTECTED]>
> wrote:
>
> > I'm not sure its complaining about the thread shutting down, but
> > rather that you're trying to unbind a service that is note bound to
> > "Service not registered".
>
> > Try keep a reference to your thread in the your Activity. in onPause()
> > your should call Thread.stop(). Override stop() in your thread to
> > unbind the service and then call super.stop().
>
> > Cheers,
> > Justin
> > Android Team @ Google
>
> > On Aug 22, 8:19 am, code_android_festival_way
>
> > <[EMAIL PROTECTED]> wrote:
> > > Hello guys!
>
> > > I'm having the following problem. I'm having an activity that starts a
> > > background thread in order to bind to a service which does some work.
> > > Now I've got the problem that when pressing the back button I get the
> > > following exception:
>
> > > 08-22 17:09:46.460: ERROR/AndroidRuntime(26218): Uncaught handler:
> > > thread Thread-8 exiting due to uncaught exception
> > > 08-22 17:09:46.460: ERROR/AndroidRuntime(26218):
> > > java.lang.IllegalArgumentException: Service not
> > > registered: [EMAIL PROTECTED]
>
> > > I've done the following in the onPause() method:
>
> > > this.unbindService(svcConn);
> > > background.interrupt();
> > > background = null;
>
> > > I don't really know how to stop that thread properly when leaving the
> > > activity. Any help would be appreciated!
>
> > > Regards!
>
>
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to