This error is a common error many developers might find if they do a silly mistake. Let’s discuss about the problem:
After inflating the RecyclerView into your view class (Activity or Fragment), you should mention the LayoutManager of it. If by mistake you miss it, Android will skip drawing the layout. Lets see the below example with mistake in it:
Since we have set the layout manager for RecyclerView, it should now be able to draw the layout properly.
NOTE: setHasFixedSize(…) has nothing to do with current problem. It is just added in the example as a good practice to make our layout drawing faster.