How to remove listview all items

后端 未结 11 2141
野的像风
野的像风 2020-12-15 15:36

In my app, if you click on a button then i want to remove all the listview items. Here, i am using the base adapter for adding the items to the list view.

How can i

11条回答
  •  借酒劲吻你
    2020-12-15 16:38

    use any one of the bellow options which suites your requirement

    listview.removeViews(1,listview.getChildCount());
    

    or

    listview.removeViewInLayout(your view);
    

提交回复
热议问题