Android开发中使用AlertDialog时点击窗口外,dialog窗口消失,解决办法:
AlertDialog.Builder builder = new AlertDialog.Builder(context);
//不关闭写法
builder.setCancelable(false);
//关闭写法
builder.setCancelable(true);
小窗口也有用activity写的,那么不想让它消失的话,则需要在
onCreate方法中加入:
this.setFinishOnTouchOutside(false);