Clear Android ListView

后端 未结 4 951
别那么骄傲
别那么骄傲 2021-01-22 10:39

I have a ListView. I want to dynamically change the contents of the listview.I used \"adapter.notifyDataSetChanged();\" to change the contents. I have also tried setting the ada

4条回答
  •  我在风中等你
    2021-01-22 11:27

    Try This

    final Handler handler = new Handler();
                     handler.postDelayed( new Runnable(){
                            @Override
                            public void run(){
                     //this line i have added in your code
                             registeredList.clear();
                            accessWebService();
                            handler.postDelayed(this, 10 * 1000);
                            Log.i("TAG", "notify");
    
                     }
                            }, 10 * 1000
    
                            ); 
    

提交回复
热议问题