You just forgot to set Adapter
to your mRecyclerViews
check in your loadData()
method
check this line //mRecyclerViews.setAdapter(mAdapter);
Try this
private void loadData(){
mArrayList = new ArrayList<>();
mArrayList.add(new Model("Constraint Layout"));
mArrayList.add(new Model("Linear Layout"));
mArrayList.add(new Model("Relative Layout"));
mArrayList.add(new Model("Card View"));
mArrayList.add(new Model("Scroll Views"));
mArrayList.add(new Model("Grid View"));
mAdapter = new MyAdapter(mArrayList);
mRecyclerViews.setAdapter(mAdapter);
}
EDIT
You need to Declare your mRecyclerView;
global like your mArrayList
and mAdapter
private ArrayList<Model> mArrayList;
private MyAdapter mAdapter;
RecyclerView mRecyclerView;
solved How to fix this RecyclerView code?