Zhao Lin Zhao Lin - 1 year ago 96
Android Question

OnItemClickListener is not working for ListView in Android Fragment

I have implemented OnItemClickListener in Android Fragment.

when i have implemented at beginning, it was working.

But yesterday i have put some ui objects in list item, after that onItemClickListener is not being called.

I have tried all day and but i did not find the solution yet.

i hope help from some who has experience in that.

Answer Source

The problem is that some ui objects in list item takes focus so main list item can not get focus.

So you need to block all focuses in sub ui objects in list item.

You can add this

      // code formate

to list item xml file.

I hope it will help you to fix