permission denied for window type 2003

 在O中报下面的错解决方法为:

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O){
            WindowManager.LayoutParams params = new WindowManager.LayoutParams();
            params.type = WindowManager.LayoutParams.TYPE_PHONE;
            dialogDesc.onWindowAttributesChanged(params);
        }else {
            WindowManager.LayoutParams params = new WindowManager.LayoutParams();
            params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
            dialogDesc.onWindowAttributesChanged(params);
        }

 

你可能感兴趣的:(permission denied for window type 2003)