how to add item to Spinner's ArrayAdapter?

前端 未结 4 1260
渐次进展
渐次进展 2020-12-30 05:21

i had a EditText , a button and a spinner . When click the button , the spinner will add a new item with name you entered in the EditText. But here is the question, my adap

4条回答
  •  渐次进展
    2020-12-30 06:00

    Javi is right except don't reference an array for the second parameter.

    adapter = new ArrayAdapter(this,
      android.R.layout.simple_spinner_item,
      someList);
    

提交回复
热议问题