RecyclerView is a great class what you should consider over ListView for building list interfaces. It offers more flexibility and has built-in hooks that make implementing animations and custom layouts much easier compared to
ListView
. UnfortunatelyRecyclerView
is missing a couple of features thatListView
had built-in. For example the ability to add anOnItemClickListener
that triggers when an item is clicked.RecyclerView
allows you to set anOnClickListener
in your adapter, but passing on that click listener from your calling code, to the adapter and to the ViewHolder, is complicated for catching a simple item click.
Android’s RecyclerView, item clicks, how to
by
Tags:
Leave a Reply