title: How to implement a Dialog with a search box?
body: <p>I have a main activity with a list and a method that receives a keyword to make a search in the database.</p>
  
  <p>I want to implement an <code>AlertDialog</code> with a search box that should appear on the main activity when I click a button through an action listener in this form</p>
  
  <pre><code>OnClickListener searchListener = new OnClickListener() {
  
      public void onClick(View v) {
          // ...
      }
  };
  </code></pre>
  
  <p>This dialog should have a simply <code>EditText</code> box and two buttons (<kbd>Search</kbd> and <kbd>Cancel</kbd>), and have to pass the <code>String</code> picked by the <code>EditText</code> to a search method in the form:</p>
  
  <pre><code>public void searchWord(String keyword){
      // ....search in DB
      // ...updateListGUIWithNewValues()
  }
  </code></pre>
  
  <p>This method is in the main activity to get the new list values so the activity can update the GUI list.</p>
  
  <p>I have already implemented the search method and the main activity but I don't know the right way to implement this kind of dialog.</p>