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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -