dialog:setCancelable与setCanceledOnTouchOutside方法的顺序不能改变,若改变,设置setCancelable为false,setCanceledOnTouchOutside就失效了。
如:
如:
dialog = new Dialog(mContext, R.style.my_dialog);
//dialog:setCancelable与setCanceledOnTouchOutside方法的顺序不能改变,若改变,设置setCancelable为false,setCanceledOnTouchOutside就失效了
dialog.setCancelable(isCancelable);
dialog.setCanceledOnTouchOutside(isCanceledOnTouchOutside);
dialog.show();
dialog.getWindow().setContentView(rootView);