title: findViewById() returns null for Views in a Dialog
body: <p>The problem is, no matter where or how I call for this layout's components, they always return null.</p>
  
  <pre><code>setView(inflater.inflate(R.layout.search_layout, null))
  </code></pre>
  
  <p>This works fine. It displays the layout inside the <code>Dialog</code>, yet, the children are always returned as null by <code>findViewById(R.id.some_search_layout_children)</code>.</p>
  
  <p>I've tried cleaning my project multiple times, tried to implement another class for my <code>Dialog</code>, called <code>findViewById()</code> as a member of my main <code>Activity</code>, inside the <code>initSearch()</code> method, and inside an anonymous implementation of <code>OnClickListener</code> for the <code>Dialog</code>, but all with the same result. I've also tried breaking the children out into independent <code>View</code>s and programmatically calling them:</p>
  
  <pre><code>TextView text = (TextView) findResourceById(R.id.new_independant_textview);
  </code></pre>
  
  <p>But, again, the same result.</p>
  
  <p>This is the relevant code:</p>
  
  <pre><code>public class Xyz extends Activity {
      public void onCreate(...) { // some listener will trigger initSearch() }
  
      private void initSearch() {
          AlertDialog.Builder searchDialog = new AlertDialog.Builder(this);
          LayoutInflater inflater = this.getLayoutInflater();
          searchDialog.setTitle("Search Photos");
          searchDialog.setMessage("Specify tag and value...");
          // R.layout.search_dialog is my custom layour, it displays fine, it works. 
          searchDialog.setView(inflater.inflate(R.layout.search_dialog, null));
          EditText tagText = (EdiText) findViewById(R.id.tagField); // WILL RETURN NULL
          searchDialog.setPositiveButton( ... ) ...
          searchDialog.show();
      }
  </code></pre>
  
  <p>This line:</p>
  
  <pre><code> EditText text = (EditText) findViewById(R.id.tagField);
  </code></pre>
  
  <p>always returns null, no matter how or where it's called – globally, local <code>final</code>, etc. – it just returns null.</p>
  
  <p>Here is the XML of my custom <code>Dialog</code> layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/search_dialog"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical" &gt;
      &lt;TextView
          android:id="@+id/tagText" 
          android:padding="7dp"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textSize="14sp"
          android:text="@string/tag" /&gt;
      &lt;EditText 
          android:id="@+id/tagField"
          android:padding="7dp"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:inputType="text"/&gt;
      &lt;TextView
          android:id="@+id/valueText" 
          android:padding="7dp"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textSize="14sp"
          android:text="@string/value" /&gt;
      &lt;EditText 
          android:id="@+id/valueField"
          android:padding="7dp"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:inputType="text"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is my <code>R.java</code> file:</p>
  
  <pre><code>public static final class id {
      public static final int action_settings=0x7f0a0011;
      public static final int add_album=0x7f0a0001;
      public static final int add_photo=0x7f0a000d;
      public static final int albums_list=0x7f0a0003;
      public static final int delete_album=0x7f0a000b;
      public static final int exit_finder=0x7f0a000f;
      public static final int new_directory=0x7f0a000e;
      public static final int open_album=0x7f0a000a;
      public static final int photos_grid=0x7f0a0000;
      public static final int rename_album=0x7f0a000c;
      public static final int search_dialog=0x7f0a0004;
      public static final int search_icon=0x7f0a0002;
      public static final int splash_rutgers=0x7f0a0009;
      public static final int tagField=0x7f0a0006; // problematic
      public static final int tagText=0x7f0a0005; / problematic
      public static final int terminate_app=0x7f0a0010;
      public static final int valueField=0x7f0a0008; // problematic
      public static final int valueText=0x7f0a0007; // problematic
  }
  </code></pre>