Android - ListView doesn't receive OnItemClick for textview with clickable links

前端 未结 5 2132
野趣味
野趣味 2021-02-02 12:55

I have a ListView that contains a TextView in each row besides a number of other views. The TextView renders html content which may contain links.

The below code appear

5条回答
  •  Happy的楠姐
    2021-02-02 13:15

    Focusable views inside a ListView item will disable the ability to select ListView items. Applying android:focusable="false" to the TextView will allow OnItemClick to work again. You may also need to apply android:focusableInTouchMode="false" to make the trackball ignore the links because clicking the trackball over a focusable element in a ListView can both click the link and the ListView item.

提交回复
热议问题