-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
缩小窗口需额外添加权限,这里分享一个我解决的方法
/**
* 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);
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels