In our android application, we always look to use the components which have very good performance in terms of time, the memory last but not the least battery.
Here are some points which I want to highlight about ListView and RecyclerView, based on we can decide which one to use.
- The very important view holder design pattern in ListView was optional that means you have to code for it. In RecyclerView it is inbuilt so need not to code.
- View holder design patterns improve the performance of ListView and RecycerView.
- RecyclerView is based on layout manager, By using different layout manager we can achieve a Vertical list, Horizontal list, Grid View, Staggered Gridview.
- ItemDecorator gives the facility to add some decoration in RecyclerView and we can add a divider line in RecyclerView between rows, In ListView we have to write manually item decoration.
- There are notifiers for particular list elements, like
So many basic differences are there which is not covered in this post. But the decision making difference is covered so you can get to know why we should use RecyclerView over ListView.