Inflating a RecyclerView inside a Dialog layout
<p>In my activity, on click of a button I am opening a Dialog which has a RecyclerView in it.</p>

<pre><code>final Dialog dialog = new Dialog(MyActivity.this);
dialog.setTitle("Details");
dialog.setContentView(R.layout.details_popup);
RecyclerView detailsRecyclerView = (RecyclerView) dialog.findViewById(R.id.detailsRecyclerView);
Button detailsCloseButton = (Button) dialog.findViewById(R.id.detailsCloseButton);

//feedbackResponseSubList contains n items

**DetailsAdapter detailsAdapter = new DetailsAdapter(R.layout.detail_item, feedbackResponseSubList);
detailsRecyclerView.setAdapter(detailsAdapter);**
detailsCloseButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });
dialog.show();
</code></pre>

<p>The close button is visible but the recyclerView is not getting populated with data. Even the methods <strong>onCreateViewHolder(), onBindViewHolder() and getItemCount()</strong> of Detailsdapter are not getting called.</p>