Material-dialogs: Error Checks before closing Dialog

Created on 1 Oct 2015  Â·  5Comments  Â·  Source: afollestad/material-dialogs

Am using google new material design text input layout as custom view and I want to validate input before closing the dialog however when I click the positive button the dialog closes without validation. How do I control the dialog not closing till I want it to?

questiodiscussion

Most helpful comment

Take a look at the Readme.md

_"If autoDismiss is turned off, then you must manually dismiss the dialog in the callback. Auto dismiss is on by default."_

Set autoDismiss to false when creating the Dialog:

MaterialDialog dialog = new MaterialDialog.Builder(getActivity())
                .autoDismiss(false)
                .build();

Later you can close the dialog by calling dismiss on the instance:

materialDialog.dismiss();

All 5 comments

Take a look at the Readme.md

_"If autoDismiss is turned off, then you must manually dismiss the dialog in the callback. Auto dismiss is on by default."_

Set autoDismiss to false when creating the Dialog:

MaterialDialog dialog = new MaterialDialog.Builder(getActivity())
                .autoDismiss(false)
                .build();

Later you can close the dialog by calling dismiss on the instance:

materialDialog.dismiss();

Thanks for this.

On Thu, Oct 1, 2015 at 10:45 AM Kai Eckardt [email protected]
wrote:

Take a look at the Readme.md

_"If autoDismiss is turned off, then you must manually dismiss the dialog
in the callback. Auto dismiss is on by default."_

Set autoDismiss to false when creating the Dialog:

MaterialDialog dialog = new MaterialDialog.Builder(getActivity())
.autoDismiss(false)
.build();

Later you can close the dialog by calling dismiss on the instance:

materialDialog.dismiss();

—
Reply to this email directly or view it on GitHub
https://github.com/afollestad/material-dialogs/issues/731#issuecomment-144692086
.

Please one more thing, how do I show the keyboard when the dialog is showing.

This question is not specific for the material dialogs. Please try to find a solution using google or StackOverflow next time. For examle: http://stackoverflow.com/a/2418314

ok. thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

palaima picture palaima  Â·  4Comments

azizimusa picture azizimusa  Â·  4Comments

imcloud picture imcloud  Â·  5Comments

MFlisar picture MFlisar  Â·  3Comments

enricocid picture enricocid  Â·  4Comments