I\'m writing a test application which keeps track of the users location. The idea is that i can start a service which then registers for location updates. For now I\'m using
Consider using a remote service. It worked for me.
How do I keep the Thread of an IntentService alive?
You don't. You do not use IntentService
in a scenario like this.
I need some mechanism which keeps the thread alive (because else the listener is not reachable anymore for status updates) and doesnt waste cpu time (I think busy looping is not the preferred way)
No, in this case a Service
is fine, because you control when the service is going away, you control the lifetime of any threads you create, etc. IntentService
is unsuitable for your intended purpose, because it controls when the service is going away and it controls the lifetime of the threads.