title: AlertDialog EditText doesn't show a soft keyboard
body: <p>When i click on a TextInputEditText, <em>which is parent of a</em> <code>LinearLayout</code> <em>added programmatically to an</em> <code>AlertDialog</code>, my keyboard doesn't show (tested on multiple devices)</p>
  
  <p>First I create a new <code>LinearLayout</code> and add a new <code>Spinner</code> to it.
  After the last item on the spinner is selected, i remove the spinner from the <code>LinearLayout</code> and add a <code>TextInputEditText</code>:</p>
  
  <pre><code>layout.removeAllViews();
  layout.addView(input);
  </code></pre>
  
  <p>When i click on the <code>TextInputEditText</code> it gets <em>focused</em> but <strong>no soft keyboard pops up</strong></p>
  
  <p><br /></p>
  
  <blockquote>
    <p><strong>However</strong> if i add the <code>TextInputEditText</code> <em>directly</em> as a <code>View</code> to the <code>AlertDialog</code>, the keyboard pops up and gets displayed correctly.</p>
  </blockquote>
  
  <p><br />
  My <code>AndroidManifest.xml</code> has no special entrys.</p>
  
  <p><br />
  My full code:</p>
  
  <pre><code>private void dialogAddContact() {
  
      ArrayList&lt;String&gt; mails = new ArrayList&lt;&gt;();
  
      final LinearLayout layout = new LinearLayout(this);
      final TextInputEditText input = new TextInputEditText(this);
      final Spinner sp = new Spinner(this);
  
      layout.addView(sp);
      layout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
  
      input.setInputType(InputType.TYPE_CLASS_TEXT);
      input.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
      [....]
  
      final ArrayAdapter&lt;String&gt; adp = new ArrayAdapter&lt;&gt;([....]);
  
      sp.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
      sp.setAdapter(adp);
      sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              Log.d(Tools.LOGTAG, position + " " + totalMails);
              if(position == totalMails - 1){
  
                  /****** Here i remove the spinner and add the input ****/
  
                  layout.removeAllViews();
                  layout.addView(input);
              }
          }
          [....]
      });
  
      final AlertDialog.Builder builder = new AlertDialog.Builder(this)
              .setView(layout, 50, 0, 50, 0)
              [....]
              });
  
      dialog = builder.create();
      dialog.show();
  }
  </code></pre>