Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Click Event on Android ListView Items

In your custom ArrayAdapter overide isEnabled method as following

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

Make your own subclass of ArrayAdapter that has AreAllItemsEnabled() return false, and define isEnabled(int position) to return false for a given item in your the ones you want to disable.


Add this to the xml

android:listSelector="@android:color/transparent"

create Adapter for that list, and there override this method

public boolean isEnabled(int position);

then return false when you want to disable the click