android - how to stop a spinner from automatically selecting an option? -


i have spinner in app im doing, , when goes onitemselcted automatically selects first option, how stop in simple way?

 spinner2.setonitemselectedlistener(new onitemselectedlistener(){                           @override                         public void onitemselected(adapterview<?> parent,                                 view view,                                 int pos, long id) { 

you can use boolean variable check if first time, not execute code. execute code second time, otherwise default behavior.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -