android - How to make spinner items disable -
i want make spinner item un-selectable or disabled how possible if using arrayadapter:
arrayadapter<string> adptr= new arrayadapter<string>(getactivity(),r.layout.custom_spinner_text,list);
list.add("select one");// want disable .when click on should not selected
list.add("hello");
you can override isenabled(int position
) of arrayadapter , return false disable specific item. example:
@override public boolean isenabled(int position) { if (position == 4 ) return false; return true; }
Comments
Post a Comment