Android Docs say:
The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views. Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network events
Actually ListView
can do all of the above if efficiency doesn't matter, and we have found many issues when we use RecyclerView
to replace ListView
:
There is no onItemClickListener() for list item selection - solution
No divider between list items - solution
No built-in overlap selector, there is no visual feedback when you click list item - solution
No addHeaderView for list header - solution
Maybe more issues ...
So when we use RecyclerView
to replace ListView
, we have to do much extra coding to reach the same effect as ListView
.
QUESTION:
- Is it worth that we replace
ListView
withRecyclerView
totally ?- if not then in which case should we better use
RecyclerView
insteadListView
, and vice versa ?