Why can't one add/remove items from an ArrayAdapter?

前端 未结 7 1270
一整个雨季
一整个雨季 2020-11-29 07:26

I am using an ArrayAdapter to populate the items to list in a android.widget.Spinner. That works all fine.

But now I wa

7条回答
  •  误落风尘
    2020-11-29 07:33

    In your adapter Class - Delete an Item

    remove(position);
    notifyDataSetChanged();
    

    Add an Item -

    adapter.add (newItem);
    adapter.notifyDataSetChanged ();
    

提交回复
热议问题