Skip to content Skip to sidebar Skip to footer

Only 1 Button Enable In Listview, Custom Adapter

I run into a problem where I need to enable my button in the ListView. The weird thing is : public class CookingStepAdapter extends ArrayAdapter { ...

Solution 1:

The reason of all buttons getting enabled is you are setting all of them enable yourself. To set any particular button enable you have to check the id or the item position to set that particular button to enable. Like this for example:-

if(clock.getID == R.id.some_id_in_xml){
    clock.setEnabled(true);
}

But before that you have to check the position of the item to select the desired item in the list.

Post a Comment for "Only 1 Button Enable In Listview, Custom Adapter"