I am using SimpleAdapter
to bind ListView
. Now, When User Clicks on Item, I want to disable that time from Click()
event. I found some tutorial for isEnabled()
but I am not understanding that how to use it ?
Please help me to solve this problem. I am using Custom ListView
.
This below code disables ListView
.
SimpleAdapter adapter = new SimpleAdapter(this, arrlist,
R.layout.topicwisequestion, new String[] { "option" },
new int[] { R.id.option }) {
public boolean areAllItemsEnabled() {
return ignoreDisabled;
}
public boolean isEnabled(int position) {
if (areAllItemsEnabled()) {
return true;
}
return false;
}
};
lvTWOptions.setAdapter(adapter);
lvTWOptions.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Code...
}
});