How to keep Dialog open
<pre><code>private void openDialog(){

    LayoutInflater inflater = LayoutInflater.from(TrueAct.this);
    View subView = inflater.inflate(R.layout.newdialog, null);
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage("Enter New");
    builder.setView(subView);

    blEntryExistToday = true;
    builder.setPositiveButton("ADD", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            if (!blEntryExistToday) {
                //CLOSE DIALOG
            }
            else {
                tvM.setText("An entry for this day already exist!");
                //DO NOT CLOSE DIALOG
            }
        }
    });

    builder.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            Toast.makeText(MainActivity.this, "Cancel", Toast.LENGTH_LONG).show();
            //CLOSE THE DIALOG
        }
    });

    builder.show();
}
</code></pre>

<p>No matter whether I click ADD or CANCEL, the dialog closes. How can I keep it open if <code>blEntryExistToday</code> is <code>true</code>.</p>

<p><a href="https://i.stack.imgur.com/hjsr8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hjsr8.png" alt="enter image description here"></a></p>

<p>I would like to keep the same theme as it is right now, with the color and text.</p>