android - Show a loader spinner, when the checkbox is checked -


i have checkbox, when checked, shows me spinner, can not load data's spinner contains.

llf = (linearlayout) view.findviewbyid(r.id.init_tour_foreign_producer_layout);         llf.setvisibility(view.invisible);          myspinner = (spinner)view.findviewbyid(r.id.spinner_init_tour);         myspinner.setadapter(new arrayadapter<tour>(this.getactivity(), android.r.layout.simple_spinner_item, s.getunstartedtours()));          /*---------- managing checkbox ----------*/         cballproducer = (checkbox) view                 .findviewbyid(r.id.enter_collection_check_other_tour);         cballproducer         .setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() {              @override             public void oncheckedchanged(compoundbutton buttonview,                     boolean ischecked) {                 //checked = ischecked;                 if(ischecked){                     llf.setvisibility(view.visible);                     //myspinner.setselection(1);                                     }                 else{                     llf.setvisibility(view.gone);                 }                        }          });      

to selecteditem :

myspinner.getselecteditem(); 

to item @ position :

myspinner.getadapter().getitem(position);     

hope this'll you!


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -