M Monis Ahmed Khan M Monis Ahmed Khan - 5 months ago 17
Android Question

When does the adapter implicitly refresh itself?

When does the RecyclerView.Adapter<~> refresh itself implicitly and how I can detect whether a refresh is occcurred or not?

Answer Source

RecyclerViews do not refresh by themselves. When you change the data which populates the RecyclerView you have to call the function notifyDataSetChanged() on your adapter.

recyclerView.setAdapter(myAdapter);
recyclerView.setLayoutManager(myLayoutManager);
myAdapter.notifyDataSetChanged();