From android developer (Creating Lists and Cards):
<The RecyclerView widget is a more advanced and flexible version of ListView.
Major advantage :
ViewHolder
is not available by default in ListView
. We will be creating explicitly inside the getView()
.
RecyclerView
has inbuilt Viewholder
.
In my opinion RecyclerView
was made to address the problem with the recycle pattern used in listviews because it was making developer's life more difficult.
All the other you could handle more or less.
For instance I use the same adapter for ListView
and GridView
it doesn't matter in both views the getView
, getItemCount
, getTypeCount
is used so it's the same.
RecyclerView
isn't needed if ListView
with ListAdapter
or GridView
with grid adapters is already working for you.
If you have implemented correctly the ViewHolder
pattern in your listviews then you won't see any big improvement over RecycleView
.
So, if efficiency is your concern, then yes, it's a good idea to replace a ListView with a RecyclerView.
I worked a little with RecyclerView
and still prefer ListView
.
Sure, both of them use ViewHolders
, so this is not an advantage.
A RecyclerView
is more difficult in coding.
A RecyclerView
doesn't contain a header and footer, so it's a minus.
A ListView
doesn't require to make a ViewHolder. In cases where you want to have a list with sections or subheaders it would be a good idea to make independent items (without a ViewHolder), it's easier and doesn't require separate classes.