Debugging Android Widget Code In Eclipse

折月煮酒 提交于 2019-12-10 01:47:58

问题


I am starting with Android programming with the help of Unlocking Android / Manning which came from Santa and is a pretty good book. After running a few little tests and examples, I'm moving towards developing the concepts for my own application.

I want my App to execute as a Home Widget and I'm using this example as my model to get started.

While I am able to load and run in the Android ADB emulator the code example in the example's Wiktionoary which is a normal Android App. I am not able to run, but only load into the emulator the Widget version of that code named SimpleWiktionary.

Am I am able to debug Android Home Widgets with the emulator? If so, what am I missing on starting/activating the Widget or having it show up in the Apps window?

T, Kenny


回答1:


Widgets don't show up with icons like most other applications would. To add one to the home screen, long press on the background wallpaper and you should see a context menu pop-up that will allow you to add a widget to the screen. If you AndroidManifest.xml is set up correctly, your widget should be shown in the menu.

You should be able to debug it by setting breakpoints in Eclipse like you would for debugging any other Android app. However, if your widget isn't displayed on the home screen, none of the code will be executed.



来源:https://stackoverflow.com/questions/2015567/debugging-android-widget-code-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!