Listeners are called back in the thread of the instance for which they registered. Usually this means that listeners' callback methods are run in the main GUI thread.
If you want to do 'heavy' work when a callback to a listener is issued, you have to do it yourself. Your listener should start/resume an AsyncTask (or Future task created from ExecutorService), return immediately and your AsyncTask should do the 'heavy work and post the result back to the main GUI thread. On Aug 25, 8:04 am, DaminouU <dam.le...@gmail.com> wrote: > Hi everybody, > > I would like to know how to run a listener on an isolated thread. > Because I would like to use a LocationListener and make some > calculations in the main thread. So the LocationListener would be > "slow down", because of those calculations. > > Is it possible to have it run in a different thread? Or is it by > default in a separate thread? > > Thanks, > > Best regards, > > D. --~--~---------~--~----~------------~-------~--~----~ 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-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---