OnItemCLickListener not working in listview

前端 未结 24 2337
悲&欢浪女
悲&欢浪女 2020-11-22 11:21

Activity class code:

conversationList = (ListView)findViewById(android.R.id.list);
ConversationArrayAdapter conversationArrayAdapter=new  Conver         


        
24条回答
  •  庸人自扰
    2020-11-22 11:45

    I just found a solution from here, but by deep clicking.

    If any row item of list contains focusable or clickable view then OnItemClickListener won't work.

    The row item must have a param like android:descendantFocusability = "blocksDescendants".

    Here you can see an example of how your list item should look like. Your list item xml should be... row_item.xml (your_xml_file.xml)

    
    
        // your other widgets here
    
    
    

提交回复
热议问题