title: How to close a Dialog in Android programmatically?
body: <p>How do I close a Dialog in android programmatically for example by a button?</p>
  
  <p>Imagine I have a Dialog with a OK button on it, and want to close it by OK button, but I cant do that!</p>
  
  <p>I googled and found nothing useful, and almost all of them for closing AlertDialog not a Dialog.</p>