Arun Abraham
Arun Abraham

Reputation: 4037

Debugging not working in a service class ?? what can cause this issue?

All of a sudden I am not able to debug anything that i am doing in a service even though i put breakpoints all over. but logging shows that all the lines are getting executed. Can someone tell me what could be causing this issue. I am using eclipse and i have set to "Build automatically".

Upvotes: 3

Views: 2306

Answers (2)

tbruyelle
tbruyelle

Reputation: 13045

Do you have an Activity which is launched at the beginning of your application?

If not you have to manually activate the debug on your process by using the DDMS tool in Eclipse.

In DDMS -> Devices, check your process (the line contains the package name of your app), select it and then click on the debug button. A debug icon will appear near your process, then you should be able to use breakpoints in your Service.

Upvotes: 5

Pescolly
Pescolly

Reputation: 942

If you are using a Runnable try placing this in the run() method:

android.os.Debug.waitForDebugger();

Upvotes: 1

Related Questions