M Monis Ahmed Khan M Monis Ahmed Khan - 1 year ago 34
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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download