Disable Click Event on Android ListView Items

user2143831 picture user2143831 · Apr 19, 2013 · Viewed 38.7k times · Source

I'm trying to disable multiple click events on listview, say after pressing first click some media gets played from webservice, while it gets played, other items need to be clickable==false , after media got played,other list items can be clickable.

What I'm trying is calling setClickable(true) and setClickable(false) on ListView Object.

Answer

MaxEcho picture MaxEcho · May 29, 2014

In your custom ArrayAdapter overide isEnabled method as following

@Override
public boolean isEnabled(int position) {
    return false;
}