LinearLayoutManager cannot resolve getOrientation() LinearLayoutManager cannot resolve getOrientation() android android

LinearLayoutManager cannot resolve getOrientation()


Change

private RecyclerView.LayoutManager mLayoutManager;

to

private LinearLayoutManager mLayoutManager;


I got the same issue when I create a divider.You can simply put the orientation yourself, LinearLayoutManager.VERTICAL or LinearLayoutManager.HORIZONTAL, according to the orientation your RecyclerView. It works for me.


You can use code below at CardView at XML file Not at recyclerView.

android:layout_marginTop="8dp