Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 6.0+版本,视频窗口缩放需运行权限,已解决! #4

Open
checkming opened this issue Jun 12, 2018 · 1 comment

Comments

@checkming
Copy link

checkming commented Jun 12, 2018

缩小窗口需额外添加权限,这里分享一个我解决的方法
/**
* 6.0视频窗口运行权限
*/
if (Build.VERSION.SDK_INT >= 23) {
if (!Settings.canDrawOverlays(context)) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return;
} else {
//TODO do something you need
if (floatView != null) {
// 添加悬浮窗 View 到窗口
windowManager.addView(floatView, layoutParams);
}
}
} else {
//Android6.0以下,不用动态声明权限
if (floatView != null) {
// 添加悬浮窗 View 到窗口
windowManager.addView(floatView, layoutParams);
}
}

@lzan13
Copy link
Owner

lzan13 commented Jun 12, 2018

恩 感谢分享,我这个暂时还没有添加运行时权限适配,后边会升级搞一下 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants