Breakpoint not getting hit?

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Breakpoint not getting hit?

Postby felixwatts » Wed Jun 23, 2010 7:26 pm

Hi,

I have an activity that is supposed to start in response to an intent (not launched by user directly). I have a breakpoint on the first line of my activity's onCreate method. When I run the activity with the debugger attached the breakpoint does not get hit, even though code after it is definitely being executed (setContentView). My Application is marked as debuggable in the manifest.

Any ideas what I'm doing wrong?

Thanks
felix
felixwatts
Freshman
Freshman
 
Posts: 6
Joined: Wed Jun 23, 2010 6:43 pm

Top

Re: Breakpoint not getting hit?

Postby felixwatts » Thu Jun 24, 2010 12:30 pm

I solved this my adding

Debug.waitForDebugger()

as the first line in my onCreate(). This allows the debugger to attach before continuing, so breakpoints will be hit.
felixwatts
Freshman
Freshman
 
Posts: 6
Joined: Wed Jun 23, 2010 6:43 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 3 guests