Which method of the adapter returns the number of rows?

  1. countRows()
  2. size()
  3. onBindViewHolder()
  4. getItemCount()
Answer

D) getItemCount()

getItemCount tells RecyclerView how many items exist.

Computer Science MCQ · More Lab: Displaying Data from an API MCQs · Practise