title: Avoid passing null as the view root (when inflating custom layout in AlertDialog)
body: <p>Trying to inflate a custom layout for an AlertDialog, but keep getting this waring. I've seen several different solutions to this but don't know which is correct for my scenario. What is the actual correct way of getting rid of this null warning?</p>
  
  <blockquote>
    <p>Avoid passing null as the view root (need to resolve layout parameters on the inflated layout's root element)</p>
  </blockquote>
  
  <pre><code>@Override
  public void onClick(View v) {
    AlertDialog alertDialog = new 
    AlertDialog.Builder(getActivity()).create();
  
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View content = inflater.inflate(R.layout.dialog_customd, null);
    alertDialog.setView(content);
  
    alertDialog.show();
  }
  </code></pre>