Skip to content
Advertisement

Recycler view inside full screen alert dialog does not showing items

I have a recycler view inside my full screen alert dialog, but for some reason it doesn’t display any of the items inside the ArrayList passed to the adapter.

I tried:

  • Initializing the adapter after adding the items inside the ArrayList
  • Use notifyItemInserted instead of using notifyDataSetChanged
  • Checking if there is a problem with the item layout

My method that creates the full screen dialog:

JavaScript

My Adapter:

JavaScript

My Dialog view:

JavaScript

My item view layout:

JavaScript

Advertisement

Answer

You have forgot to add LayoutManager to Recyclerview. If you are listing it vertically you can add layout manager as the following:

In View:

JavaScript

In Code:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement