code: private void inflateListView(@NonNull final ViewGroup contentContainer) {
          View listView = contentContainer.findViewById(android.R.id.list);
          this.listView = listView instanceof RecyclerView ? (RecyclerView) listView : null;
  
          if (this.listView == null && !getDialog().isCustomViewUsed()) {
              LayoutInflater layoutInflater = LayoutInflater.from(getContext());
              View view = layoutInflater
                      .inflate(R.layout.material_dialog_list_view, contentContainer, false);
              this.listView = view.findViewById(android.R.id.list);
              getDialog().setView(view);
              this.inflatedCustomView = true;
          } else {
              this.inflatedCustomView = false;
          }
  
          View divider = contentContainer.findViewById(R.id.list_divider);
          this.listDivider = divider instanceof Divider ? (Divider) divider : null;
      }
docs: Inflates the list view, which is used to show the dialog's list items.
  
  @param contentContainer
  The view group, which contains the dialog's content, as an instance of the class
  {@link ViewGroup}. The view group may not be null