1.

What is RecyclerView how its different from ListView?

Answer»

The Recycler view is the most advanced component of Android.  We can also say that RecyclerView is the most advanced FORM of ListView. Recycler view is containing new feature like ViewModel,  Adapter, LayoutManager, SoothScroller. There are many differences many difference between listview and RecyclerView.

In ListView we cannot do HORIZONTAL scrolling while in RecyclerView we have both OPTION Horizontal and Vertical Scrolling.

In  RecyclerView class, it is using a ViewHolder OBJECT which is used by the adapter to bind ViewHolder with a position while in ListView we are not using ViewHolder.

In  ListView, if the data set is changed you have to call the notifyDataSetChanged method of the underlying adapter to refresh data. While in a RecyclerView adapter, if a single item or a range of items have changed, there are methods to NOTIFY the change accordingly like notifyItemChanged and notifyItemRangeChanged.



Discussion

No Comment Found

Related InterviewSolutions