How do I use the Eclipse debugger in an AsyncTask when developing for Android?

前端 未结 2 839
名媛妹妹
名媛妹妹 2020-12-05 00:55

I\'m running ADT (Android Development Tools) in Eclipse and verified that my debugger is working by putting a breakpoint in MainMenu.oncreate (class Activity).

2条回答
  •  无人及你
    2020-12-05 01:10

    in addition to sargas's answer , because in Run mode you could get an error if you forget to comment that line, you could use the following:

    if(android.os.Debug.isDebuggerConnected())
        android.os.Debug.waitForDebugger();
    

    so it takes care of itself.

提交回复
热议问题