开发者

How do you debug an Android IntentService?

I'm using Eclipse and have an emulator running Android 2.1 and my IntentService. I'd like to step through my onHandleIntent() overridden function. I've put in a breakpoint on the first statement of the function, which is C开发者_运维百科ontext context = getBaseContext();. When the intent is called the program just fails and does not go to debug view in Eclipse.


Add android.os.Debug.waitForDebugger(); statement before the breakpoint in your intentservice code.

This worked for me.


debugging multi-thread app is hard as there is no order in which things are executed, each thread will do its tasks as quickly as possible.

try trace messages to debug your code. anyway you should be able to debug your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜