AndroidDev21921 AndroidDev21921 - 5 months ago 33
Android Question

Listview Item only clickable after scrolling

I have a listview with a custom adapter. Everything populates correctly, however, I can only click on a listview item if i scroll the listview up and down. I've tried a bunch of SO answers, but nothing so far has worked, any help would be appreciated.

Answer Source

How do you set the click listener? Do you use listView.setOnItemClickListener(...) or use some view.setOnClickListener() inside the adapter? It seems you use the second approach and set the listener only after the views are reused (using convertView), not immediately after they're inflated. If that's the case check and update the conditions inside the getView() method of the adapter.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download