ListView OnItemClickListener is not listening

前端 未结 1 1233
礼貌的吻别
礼貌的吻别 2021-01-29 05:24

I checked all the previous questions regarding this issue , but none of them are helpfull to me .

My listview is not responding , i tried changing this list.set

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-29 06:18

    If any row item of list contains focusable or clickable view then OnItemClickListener won't work such as for checkbox or button etc in the row item.There are two solution:

    1. row item must be having param like android:descendantFocusability="blocksDescendants"

    
    
        // your other widgets here
    
    
    

    2. Set given two attributes to false like

     android:focusable="false"
       android:focusableInTouchMode="false"
    

    For example if there is any checkbox or button or image in the row item then

    
    

    0 讨论(0)
提交回复
热议问题