I have a custom dialog that dismisses when you click outside of the dialog, which is what I do not want. Having dialog.setCanceledOnTouchOutside(false);
does not fix the problem. What am I doing wrong?
dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCanceledOnTouchOutside(false);
dialog.setContentView(R.layout.twitter_dialog);
// set up edit text and other widgets
dialog.getWindow().setLayout(450, 280);
dialog.show();
EDIT: I am calling this dialog from another dialog that has setCanceledOnTouchOutside(true). Before this dialog is called, the previous dialog is dismissed.
This work for me:
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
you can use getDialog().setCanceledOnTouchOutside(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With