简体   繁体   中英

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 approach works fine for a normal app, so what I do I need to change to make this work for a widget?

考虑小部件ListView以及如何处理点击,也许您应该看起来像onItemClick一样在小部件内部进行选择?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM