title: Android - Dialog Button onClick -> EditText Value
body: <p>I have a "Search" Button in my Options menu, which shows a Dialog with the Search Mask.
  So when you click on the Search Button it should start the actual search.</p>
  
  <p>What I'm trying to do in my onCreateDialog is:</p>
  
  <pre><code>Button search_button = (Button) dialog.findViewById(R.id.d_search_button);
  search_button.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
      EditText text = (EditText) v.findViewById(R.id.d_search_text);
    }
  });
  </code></pre>
  
  <p>Which won't work because text is null, so what is the best way to access the Search Text?</p>