AdapterViewFlipper in app widget: setPendingIntent

2019-03-03 00:47发布

问题:

I am changing a ListView in my app widget to an AdapterViewFlipper. The problem is, I need to handle a click on an item. It worked perfectly to set a pending intent template with setPendingIntentTemplate() to the whole ListView and set a fillInIntent with setOnClickFillInIntent() to each of its items. But now, with AdapterViewFlipper, it doesn't work anymore. Am I missing something?

回答1:

You must not call setOnClickFillInIntent() with the id of the item's root view. Use any child view instead.