Debugging an Android Thread / Service

Trying to debug an Android application recently, Eclipse wasn’t stopping on my breakpoints following an asynchronous / threaded API call.

This single line of code solved my problem:
[java]
android.os.Debug.waitForDebugger();
[/java]

This will cause the Android Debugger to attach even after launching the application normally.

Hope this helps!


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *