Why is OnItemSelectedListener only called when an item changes, but not on every user selection?

后端 未结 3 1005
说谎
说谎 2021-01-17 21:48

I\'m using spinner controls in an Android application, and I handle user selections via an onItemSelectedListener() method. This seems to work okay when a diffe

3条回答
  •  情歌与酒
    2021-01-17 22:43

    Add the same adapter every time if you want to do it using default spinner :

    @Override public void onItemSelected(AdapterView adapter, View v, int position, long lng) {

       spinner.setAdapter(adapter);
    
    }
    

提交回复
热议问题