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:
onCreateViewHolderonBindViewHoldergetItemCount
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
CustomAdapterwhen will we use the Recyclerview? - What is the purpose of the method
onCreateViewHolder? - What is the purpose of the method
onBindViewHolder?