1、Unable to add window android.view.ViewRootImpl$W@37a79bd – permission denied for window type 2003
// alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
改为:alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST);