title: Populating a Spinner in AlertDialog
body: <p>I am trying to populate a spinner in an AlertDialog using the following code:</p>
  
  <pre><code>ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;&gt;(this,
              android.R.layout.simple_spinner_item, providersList);
  
      dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      AlertDialog.Builder checkInDialog1 = new AlertDialog.Builder(this); 
      checkInDialog1.setView(R.layout.layout_checkin_items);
  
      checkInDialog1.show();
      AlertDialog builder = checkInDialog1.create();
      Spinner checkInProviders = (Spinner) builder.findViewById(R.id.providers);
      checkInProviders.setAdapter(dataAdapter);
  </code></pre>
  
  <p>But builder.findViewById is returning null for checkInProviders.</p>
  
  <p>In my XML:</p>
  
  <pre><code>&lt;Spinner
          android:id="@+id/providers"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  </code></pre>
  
  <p>Please help. Thanks.</p>