ClickableSpan on TextView in App Widget
I have created an App Widget for Android 1.5. It uses a TextView to present a number of individual Text Links using ClickableSpans. However, the onClick event handler on the ClickableSpan is never called, it appears that you can not select individual components on the widget just the whole widget.
This ap开发者_如何学运维proach works fine for a normal app, so what I do I need to change to make this work for a widget?
I think the only way you are going to be able to get clicks to work on app widgets is by assigning onClickPendingIntents to specific elements of your widget's UI. You don't get a onClick callback of click events in App Widgets.
Thinking of the widget ListView, and how clicks are handled, maybe you should look something like onItemClick, to select inside your widget?
精彩评论