title: Inflate in AlertDialog custom view and get information entered
body: <p>I need to insert in AlertDialog view a custom view with sub elements, like EditText. This works well, but when user click in AlertDialog ok button, I need to get the information of sub elements, but instead of get the text that I inserted in UI I get empty string or null pointers like can see in Log.e() in code.</p>
  
  <p>AlertDialog:</p>
  
  <pre><code>final AlertDialog.Builder alert = new AlertDialog.Builder(context);
  alert.setTitle("Title");
  
  alert.setView(getLayoutInflater().inflate( R.layout.sonidovideo, null ) );
  alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int whichButton) {
  
  
      EditText a = (EditText) findViewById(R.id.segundos);
      EditText b = (EditText) findViewById(R.id.segundosFin);
      EditText c = (EditText) findViewById(R.id.segundosInicio);
      Spinner d = (Spinner) findViewById(R.id.calidades);
      Spinner e = (Spinner) findViewById(R.id.detecciones);
  
  
      Log.e("Is null", (a==null) + ""); //False
      Log.e("No text",(a.getText().toString().compareTo("")==0) + ""); //True
  
      Log.e("Is null", (b==null) + ""); //True
  
      Log.e("Is null", (c==null) + ""); //True
  
      Log.e("Is null", (d==null) + ""); //True
  
      Log.e("Is null", (e==null) + ""); //True
  
  
  
      }
  });
  
  alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int whichButton) {
  
      dialog.cancel();
  }
  });
  alert.show(); 
  </code></pre>
  
  <p>R.layour.sonidovideo(sonidosvideo.xml):</p>
  
  <pre><code>&lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="match_parent" &gt;
  
  &lt;EditText
      android:id="@+id/segundosInicio"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/textView3"
      android:ems="10"
      android:inputType="numberDecimal" /&gt;
  
  &lt;EditText
      android:id="@+id/segundos"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/textView2"
      android:ems="10"
      android:inputType="numberDecimal" &gt;
      &lt;requestFocus /&gt;
  &lt;/EditText&gt;
  
  
  
  &lt;Spinner
      android:id="@+id/detecciones"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/textView4"
      android:entries="@array/detecciones" /&gt;
  
  &lt;EditText
      android:id="@+id/segundosFin"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/textView6"
      android:ems="10"
      android:inputType="numberDecimal" /&gt;
  
  &lt;Spinner
      android:id="@+id/calidades"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/segundosFin"
      android:entries="@array/calidades" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>For get te sub items I also try this but the result is the same</p>
  
  <pre><code>EditText a = (EditText) getLayoutInflater().inflate( R.layout.sonidovideo, null ).findViewById(R.id.segundos);
  </code></pre>
  
  <p>Any help is appreciated.</p>