android - stop onitemselected event for spinner get activitated on orientation change of phone -
i implemented spinner in app,and onitemselected
event , working fine.but problem event triggered on "orientation change" of phone don't want.
here code event
arrayadapter<string> dropadapter = new arrayadapter<string>(this,android.r.layout.simple_spinner_item, lasttime); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); final spinner items = (spinner) findviewbyid(r.id.timescan); items.setadapter(dropadapter); items.setonitemselectedlistener(new onitemselectedlistener() { public void onitemselected(adapterview<?> parentview, view selecteditemview, int position, long id) { // code here string temp = items.getselecteditem().tostring(); toast.maketext(getapplicationcontext(), "click listitem number " + position, toast.length_short) .show(); mviewpager = (viewpager) findviewbyid(r.id.pager); mviewpager.setvisibility(view.invisible); view loader = (view) findviewbyid(r.id.preloader); loader.setvisibility(view.visible); new read().execute(7); } public void onnothingselected(adapterview<?> parentview) { // code here } });
i dont want event trigger on orientation change of phone. please suggest way solve problem.
simplest solutions :
open androidmanifest.xml
<activity android:name="youractivity name" android:configchanges="orientation|screensize|keyboardhidden" android:windowsoftinputmode="statehidden|adjustresize" />
Comments
Post a Comment