RecyclerView is not showing anything

这一生的挚爱 提交于 2019-12-06 01:52:01

Collections.emptyList() returns an empty immutable list, you should use new ArrayList<>() instead.
Then after you add/remove data from the list must call notifyDataSetChanged() for the changes to be seen.
Also getItemCount() should return dataList.size()

You are returning 0 on getItemCount(). Make sure you return the size of list that backs the RecyclerView

I also had the same problem..Your code is completely fine but it is not displaying any list because you are returning 0 in method getItemCount().Just return dataList.size() in your case and it wil work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!