Skip to content Skip to sidebar Skip to footer

Android Handlerthread Stops Working When Device Unplugged From Usb Cable

My application includes a Service that spawns a HandlerThread that periodically requests a location update from the LocationManager. Each time I receive a location updated I disabl

Solution 1:

Thanks dragonroot, your suggestion helped me realise what the problem was.

The issue was that I had a call to Debug.waitForDebugger(); in the HandlerThread. As soon as the USB cable is detached this call stalls forever, since no debugger connection can be found.

A very basic mistake in hindsight, hopefully this will help someone else avoid it.

Post a Comment for "Android Handlerthread Stops Working When Device Unplugged From Usb Cable"