I have overriden the onclick method in onPositive of the dialog and there i check whether anything is entered in the editText in the dialog box. If it is i want to dismiss the dialog if not then do not dismiss the dialog. I put if-else condition for checking if editText is empty but by default the dialog is dismissed after clicking on Positive button.
if(string!=null && !string.isEmpty()){
dialog.dismiss();
}
else{
Toast.makeText(context,"Enter something,LENGTH.SHORT);
}
See here
The .positiveText method of this dialog only takes one parameter (the title of the positive button). I can't pass null as done in the stackoverflow eg..
You can pass null if you cast to a String, null by itself is ambiguous cause the compiler doesn't know if you mean positiveText(int) or positiveText(String).
However, you should not do that anyways. Instead, don't use positiveText() at all. The default is null already.
Also, that StackOverflow post has nothing to do with this library.
If you read the README documentation, you'd see there's an autoDismiss property which is true by default. When disabled, the dialog will remain open. @sarthak1996 @peppe130
Thanks a lot....
See here
I have a question about the solution in this link. I extend AppCompatDialogFragment from my class, and I override the onCreateDialog method. So, I tried to solve my problem with this solution which is given in link. But I did not understand class structure like which class is extended, which function is overrided. Can you tell me which class is extended and which function is overrided?
Most helpful comment
Also, that StackOverflow post has nothing to do with this library.
If you read the README documentation, you'd see there's an
autoDismissproperty which is true by default. When disabled, the dialog will remain open. @sarthak1996 @peppe130