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. UnfortunatelyRecyclerViewis missing a couple of features thatListViewhad built-in. For example the ability to add anOnItemClickListenerthat triggers when an item is clicked.RecyclerViewallows you to set anOnClickListenerin 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