android spinner fire event when same item selection is made

前端 未结 5 1524
迷失自我
迷失自我 2020-12-10 12:25

I want to fire a event when the same item is selected in spinner. Method

@Override
    public void onItemSelected(AdapterView parent, View arg1, int         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 12:33

    Since my reputation is not high enough to comment directly on @Suat 's answer, I tried that method, it works like charm, but I'm not clear what the side effects could be. Something I want to add is, additional constructors should be added to avoid errors.

    public SpinnerTrigger(Context context, AttributeSet attrs, int defStyle)
    { super(context, attrs, defStyle); }
    
    public SpinnerTrigger(Context context, AttributeSet attrs){
    super(context,attrs);
    

    }

提交回复
热议问题