I\'m doing some AsyncTask
work after user clicks an item in my ListView
. I\'d like to disable the item so it can\'t be clicked twice. I\'ve simplif
So, you may be using a custom adapter too. If you do, override these methods:
public boolean areAllItemsEnabled() {
return false;
}
public boolean isEnabled(int position) {
// return false if position == position you want to disable
}
Then, when you receive a click tell the adapter what was the last item clicked and return false on isEnabled
for that position. For instance, you can have a method like this in your adapter:
private int mLastClicked;
public void setLastClicked(int lastClicked){
mLastClicked = lastClicked;
}