Dialog 点击对话框外部区域不关闭的设置

在Android开发中,常常需要调用对话框,但会遇到这样一种情况,在显示对话框的时候,点击对话框以外的屏幕其他区域,会关闭对话框。以下是解决该问题的设置:


AlertDialog.Builder builder = new AlertDialog.Builder(context);

 
//关闭写法
builder.setCancelable(false); 
 
//关闭写法
builder.setCancelable(true); 



引用:http://blog.sina.com.cn/s/blog_8f1c79dd0101a63u.html

你可能感兴趣的:(android,开发,builder,false,对话框,AlertDialog)