views:

317

answers:

2

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?

A: 

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

Sephy
That's not how app widgets work.
mbaird
A: 

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.

mbaird
It seems you are right. Thanks. Time for a bit of a redesign for my widget then.
Dave Allison