I try to use RecyclerView with RecyclerView.Adapter but here is something wrong. I post my code below:
Layout:
I got this error when my RecyclerView had no LayoutManager. Adding this code fixed the problem:
recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));