Well I'm starting a service from my main thread. (some activity) In the service I'm starting a new thread and do some work. (communication with external APIs (flickr)) While that work I need the position of the device. To get the position I had written this class:
http://paste.pocoo.org/show/80ypWR00yHnHRz9pN7mc/ In M5 I only called "getCurrentLocation()" and everything was fine. Now as the methode is gone I need to set this update request to the LocationManager in order to get a not outdatet position. To achieve that I have to loop inside my "geo location" class and wait for the Listener to be invoked in order to be able to return some location from the "geo location" class. Now I don't really know how to do that the right way. (not blocking the thread) I would appreciate every hint that you could give me. I dont really know how to handle that situation. Best Regards! On 21 Aug., 14:47, Mark Murphy <[EMAIL PROTECTED]> wrote: > code_android_festival_way wrote: > > Could it be that my "while" loop blocks the class (thread) and so the > > listenere cant be invoked? > > Sorry, I haven't looked at your code. But you may be right on this. > > Android applications have the main event thread, plus any secondary > threads you create on your own. Listener callbacks, AFAIK, happen on the > main event thread, which is why you can update UI elements without muss > or fuss. If your while loop is also on the main event thread, you never > release that thread, and hence your listeners may never be called. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Warescription: All titles, revisions, & ebook formats, just $35/year --~--~---------~--~----~------------~-------~--~----~ 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 [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 -~----------~----~----~----~------~----~------~--~---