To use RecylerView from Android we need to create a CustomAdapter
class that extends from abstract class RecyclerView.Adapter
, then implement three methods that are:
-
onCreateViewHolder
-
onBindViewHolder
-
getItemCount
getItemCount
method knows that it returns the number of items in RecyclerView, but the Adapter class itself and the onCreateViewHolder
and onBindViewHolder
methods leaves me confused and in doubt as to its purposes and functions, these questions will be addressed below.
Questions
CustomAdapter
when we use the
RecyclerView? onCreateViewHolder
method? onBindViewHolder
method?