
set a LinearLayoutManager with default orientation RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView) With Default Vertical Orientation: // get the reference of RecyclerView In below code snippet we show how to use this constructor in Android. In this we need to set only one parameter i.e used to set the context of the current Activity. Public constructor for LinearLayoutManager: Below we define the public constructor for LinearLayoutManager that should be used for defining orientation(vertical or horizontal) of RecyclerView.ġ) LinearLayoutManager(Context context): It is used to create a vertical LinearLayoutManager. In Simple words we can say that we use the LinearLayoutManager for displaying RecyclerView as a ListView. If we need a list(vertical or horizontal) then we need to use LinearLayoutManager setting with require orientation. LinearLayoutManager is used for displaying the data items in a horizontal or vertical scrolling List.

It contains the references for all the views that are filled by the data of the entry. In RecyclerView android provides a lots of new features which are not present in existing ListView or GridView. This new widget is a big step for displaying data because the ListView is one of the most commonly used UI widget.

Material Design brings lot of new features in Android that changed a lot the visual design patterns regarding the designing of modern Android applications.

RecyclerView was introduced in Material Design in API level 21 (Android 5.0 i.e Lollipop). It is a container used for displaying large amount of data sets that can be scrolled very efficiently by maintaining a limited number of views. In Android, RecyclerView is an advanced and flexible version of ListView and GridView.
