Remove all items from RecyclerView
问题 I am trying to remove all the elements from my RecyclerView in my onRestart method so the items don't get loaded twice: @Override protected void onRestart() { super.onRestart(); // first clear the recycler view so items are not populated twice for (int i = 0; i < recyclerAdapter.getSize(); i++) { recyclerAdapter.delete(i); } // then reload the data PostCall doPostCall = new PostCall(); // my AsyncTask... doPostCall.execute(); } But for some reason the delete method I created in the adapter is