Home » Android » android – when does getItemCount() method get called in RecycleView adapter?

android – when does getItemCount() method get called in RecycleView adapter?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a adapter which populates data to RecyclerView.

I am not calling notifyDataSetChanged() and I am setting the adapter to the RecyclerView in onCreateView() (so in getItemCount() should be called once) in Fragment but I find getItemCount() called multiple times.

How to&Answers: