android spinner performClick onItemSelected

后端 未结 3 1455
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 09:22

I have a little problem with a spinner.

I create a Spinner the user click a Button. The Spinner is shown as it should be, but

3条回答
  •  旧时难觅i
    2020-12-19 09:38

    This looks enough like the turorial, so refer back to that. See below:

    I don't see this, but does the main class implement OnItemSelectedListener? Also, You'll want to instantiate the Spinner inside the onCreate() within the main class body.

    This line needs to be within the onCreate();

    spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
    

提交回复
热议问题