• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Debug AppWidget

dpak23in

Lurker
Hello,

I need to know how can we debug an AppWidget. It is easy to debug any code which has an activity that is launched every time we run the application. But AppWidget does not have an activity and thus is not launched from eclipse. It just gets synced on the device and then we can run this widget by clicking on its name in the widget menu on the emulator. I believe that after syncing over to the emulator there is no connection whatsoever between eclipse and emulator. Is there any other way which can help me debug appWidget?

Thanks
Deepak
 
You debug it the same way as you would with an activity. Set breakpoint, start the debugger on the process and do something to which causes the code with breakpoints to run. E.g. put the breakpoint on the first line after onUpdate() and add your widget to the homescreen.
 
Back
Top Bottom