Introduction of RecyclerView in Android

Introduction:

Recycler View is a new widget of Android i.e. “android.support.v7.widget.RecyclerView”.Recycler View is an advanced form of ListView and GridView.It works like a ListView but it is more flexible and advance with the large data set.By using LayoutManager class in RecyclerView we can show the items in horizontally and vertically scrolling list.

Classes & Methods:Classes:ViewHolderThis class is used to hold the reference of each item of RecyclerView.Methods:onCreateViewHolder(..)In this method, we create a new view by inflating the layout and create the ViewHolder.onBindViewHolder(..)Here we get the data for the particular position from our Model class.These are the important classes and methods that are defined above to create RecyclerView in android.Example with code:To create Recycler View we have to add the dependency for RecyclerView in build.gradle i.e.build.gradle

Output:

Conclusion:

This is the basic idea to create RecyclerView in Android. It is just an advanced form of ListView.We can customize it according to the need of the application. This feature is very popular in Android development.
Keep visiting our site www.acadgild.com for more updates on Android and other technologies.