Spinner : onItemSelected not called when selected item remains the same

后端 未结 10 703
不思量自难忘°
不思量自难忘° 2020-11-28 07:12

I have a OnItemSelectedListener for my Spinner, but it is not called when the selected item is the same as the previous one. Apparently the O

10条回答
  •  囚心锁ツ
    2020-11-28 08:05

    If it's still actual, correct call of the callback should be

    @Override
    public void setSelection(int position) {
        super.setSelection(position);
        if(listener != null)
            listener.onItemSelected(this, getChildAt(position), position, 0);
    }
    

    Martin

提交回复
热议问题