【转】Android AlertDialog 点击对话框外部区域不关闭的设置

原文网址:http://blog.sina.com.cn/s/blog_8f1c79dd0101a63u.html

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

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

原文地址:https://www.cnblogs.com/wi100sh/p/5550367.html