Understanding RecyclerView.ViewHolder

Viewed 4765

I'm having hard time understanding working of view holder, here are my some question that could increase my understanding of viewholder:

It is said that oncreateViewHolder returns viewholder object, What is viewholder object does it contain all the views in single row? if there is list of 1000 item how many viewobjects will be created?

My understanding: If we are creating viewholder object it contains reference of view like findviewbyid, since findviewbyid is expansive operation, so by viewholder we can create single viewholder object and reuse by just setting image or text(happens in onBindView).

But onCreateViewHolder runs multiple times and as a result findviewbyid will also execute multiple time, isn't performance issue?

Also how its different from convertView of base adapter of simple listview

Thanks!

4 Answers
Related