Create your account

Already have an account? Login here


Create account

64. Implement RecyclerView.Adapter

Design + Code an Android App from Scratch

Woah, wait a second..



This video shows you how to implement RecyclerView.Adapter class. In the first step, we create a class that extends from RecyclerView.Adapter. In the second step, create a class that extends from the RecyclerView.ViewHolder that specifies the layout for a single item inside the RecyclerView. Next we implement the onCreateViewHolder, the onBindViewHolder and getItemCount methods inside the RecyclerView.Adapter subclass. We get a Java object that represents the XML layout of a single item which we created in the previous video and supply this Java View object to the subclass of the RecyclerView.ViewHolder. The idea behind using a ViewHolder is to avoid calling findViewById for each row in the RecyclerView. The onBindViewHolder lets you put data inside each row which the user eventually sees on the screen.

Course Cirriculum