title: How to remove AlertDialog programmatically
body: <p>In an android application, I'm showing to the user an AlertDialog with no buttons, just a message. How can I destroy the AlertDialog programmatically so that it's not visible anymore? I tried with cancel() and dismiss() but they are not working, the view remains there.</p>
  
  <pre><code>AlertDialog.Builder test = new AlertDialog.Builder(context);
  test.setTitle("title");
  test.setCancelable(true);
  test.setMessage("message...");
  test.create().show();
  </code></pre>
  
  <p>then I tried </p>
  
  <p><code>test.show().cancel()</code> and</p>
  
  <pre><code>test.show().dismiss()
  </code></pre>
  
  <p>but not working.</p>