Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

Thinking of the widget ListView, and how clicks are handled, maybe you should look something like onItemClick, to select inside your widget?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top