6
To use the Recylerview Android we need to create a class CustomAdapter
extending from the abstract class RecyclerView.Adapter
then implement three methods that are:
onCreateViewHolder
onBindViewHolder
getItemCount
The method getItemCount
i know it returns the amount of items in Recyclerview, but the Adapter class itself and the methods onCreateViewHolder
and onBindViewHolder
leaves me confused and with doubts regarding its purposes and workings, these doubts will be addressed below.
Doubts
- What is the purpose of the class
CustomAdapter
when will we use the Recyclerview? - What is the purpose of the method
onCreateViewHolder
? - What is the purpose of the method
onBindViewHolder
?