title: Android AlertDialog show() after hide()
body: <p>I have a trouble with <code>AlertDialog</code>. If i will call <code>dialog.show()</code> after <code>dialog.hide()</code> it will not be shown, but if I call <code>dialog.show()</code> again, all ok. If i call <code>dialog.show()</code> twice in a row, dialog showing always.</p>
  
  <p>And If replace <code>hide() -&gt; dismiss()</code> it is ok allways. But in my case i need to use <code>hide()</code> to save the dialog.</p>
  
  <p><strong>SAMPLE</strong></p>
  
  <pre><code>AlertDialog dialog;
  
  @Override
  protected void onCreate(@Nullable Bundle savedState) {
      super.onCreate(savedState);
      setContentView(R.layout.activity_auth);
      dialog = new AlertDialog.Builder(this)
          .setTitle("Title")
          .setMessage("Text")
          .setPositiveButton("Yes", (dialogInterface, which) -&gt; onYesClicked())
          .create();
      Button login = findViewById(R.id.btn_login);
      login.setOnClickListener(v -&gt; dialog.show());
  }
  
  private void onYesClicked() {
      dialog.hide();
  }
  </code></pre>
  
  <p><strong>EDITED: SOLUTION</strong></p>
  
  <pre><code>private void onYesClicked() {
      new Handler().post(() -&gt; dialog.hide());
  }
  </code></pre>