Listview vs Recyclerview

RecyclerView was released by android in Android 5.0 (LOLIPOP) update. RecyclerView is a major enhanced version of Listview. It contains many new features like ViewHolder, ItemDecorator, LayoutManager, and SmoothScroller. The Major advantage of RecyclerView over listview is its ability to have animations while adding or removing an item.

Feature ListView RecyclerView
View Holders Its not compulsory to have view holders in listview.But it is suggested to use as if not used the listview will show stale data and be laggy. Its compulsory to have view holders in recyclerview.When implementing a RecyclerView, RecyclerView.ViewHolder class is used to define a ViewHolder object which is used by the adapter to bind ViewHolder with a position. This makes the implementation a little complex, but solves the issues faced in ListView.
Layout Manager In Listview,there is only one possibility and that is vertical layout. In Recyclerview we can have 3 possibilities of the list layouts.To support multiple types of lists it uses RecyclerView.LayoutManager class.
  • LinearLayoutManager - This is the most commonly used layout manager in case of RecyclerView. Through this, we can create both horizontal and vertical scroll lists.
  • StaggeredGridLayoutManager - Through this layout manager, we can create staggered lists. Just like the Pinterest screen.
  • GridLayoutManager - This layout manager can be used to display grids, like any picture gallery.


Most viewed