Onclicklistner not working in fragment listview

前端 未结 10 1295
不知归路
不知归路 2020-12-11 06:49

I have a listview with custom adapter in listfragment and also set onclicklistner for listview. But Onclicklistner does not work.

Here is my code:

p         


        
10条回答
  •  庸人自扰
    2020-12-11 07:06

     lv.setOnItemClickListener(new OnItemClickListener() {
    
            @Override
            public void onItemClick(AdapterView parent, View view,
                    int position, long id) {
                    //your code
            }
       });
    

    I think this should work

提交回复
热议问题