Blaze Tama Blaze Tama - 9 months ago 73
Android Question

RecyclerView vs. ListView

From android developer (Creating Lists and Cards):

The RecyclerView widget is a more advanced and flexible version of

Okay, it sounds cool. But i really confuse about their difference when i saw an example picture :

enter image description here

The picture above can be easily created by
with custom adapter.

So, what do you think about this? What is the situation that fit best with


Android created RecyclerView as a ListView improvement, so yes, you can create an attached list with ListView control, but using RecyclerView is easier as it:

  1. Reuses cells while scrolling up/down - this is possible with implementing View Holder in the listView adapter, but it was an optional thing, while in the RecycleView it's the default way of writing adapter.

  2. Decouples list from its container - so you can put list items easily at run time in the different containers (linearLayout, gridLayout) with setting LayoutManager.


mRecyclerView = (RecyclerView) findViewById(;
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
  1. Animates common list actions - Animations are decoupled and delegated to ItemAnimator.

There is more about RecyclerView, but I think these points are the main ones.

So, to conclude, RecyclerView is a more flexible control for handling "list data" that follows patterns of delegation of concerns and leaves for itself only one task - recycling items.