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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -