Where knowledge empowers you to understand your world

ListView Obstacles: OnItemClickListener Not Responding

In many cases, developers implementing ListView widgets in their Android apps will want them to be clickable/tappable so that users can get more details on the item they tapped.

To achieve this, they use the OnItemClickListener. The OnItemClickListener listens for clicks on each item, rather than on the entire ListView widget.

Once implemented:Every time an item in a ListView is clicked, whichever code you place inside the OnItemClickListener is executed, and the item number is stored in an integer variable so that you can determine which item was clicked and execute whichever function you see fit.

If you tap your ListView items and nothing happens (not even an error), then it may be due to your TextView settings.

The TextView XML file created has a convenient autoLink attribute which, when enabled, causes it to automatically make web addresses and phone numbers clickable so you won’t have to copy and paste them, or manually type them in. Turning autoLink off may solve your problem as it did for me.

I know that like me, you don’t want your ListView to lose that convenient functionality, but you can pop up another screen or popup window for each item that is tapped/clicked, and use autoLink within that window instead.

Further reading: Android Tutorials.

Leave a Reply