Just implemented RecyclerView
in my code, replacing ListView
.
Everything works fine. The data is displayed.
But error messages are
This issue is because you are not adding any LayoutManager
for your RecyclerView
.
Another reason is because you are calling this code in a NonUIThread. Make sure to call this call in the UIThread.
The solution is only you have to add a LayoutManager
for the RecyclerView
before you setAdapter
in the UI Thread.
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));