在我的应用程序中,我检查叠加许可,如果我没有,我提示用户启用它的系统设置,我试图创建一个对话或祝酒,但对话没有? t出现在新活动
中 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!Settings.canDrawOverlays(this)) {
Intent overLay = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName()));
AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this);
dialog.setCancelable(true);
dialog.setTitle("Required");
dialog.setMessage("please Enable" );
final AlertDialog alert = dialog.create();
alert.show();
startActivity(overLay);
}
}