我正在尝试在来电屏幕上显示弹出视图(如truecaller)。它在oreo和所有设备的模拟器上工作正常,直到牛轧糖,在两种情况下锁定和解锁。但是在One Plus 5t(oreo)上它只是在设备解锁时工作。当设备被锁定时,视图就在呼入屏幕后面。
我正在尝试使用给定LayoutParams
的服务添加视图SELECT Names.Name, id,
Case when Score <12 or score is null
Then null
Else score end as score
FROM Names
LEFT OUTER JOIN Scores
ON Names.Name = Scores.Name
与
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
AppLog.showLog(CLASS_TAG, "Device is oreo");
params1 = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
PixelFormat.TRANSPARENT);
} else {
AppLog.showLog(CLASS_TAG, "Device is less than oreo");
params1 = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT | WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
PixelFormat.TRANSPARENT);
}
params1.gravity = Gravity.CENTER_VERTICAL;
我有什么遗漏的吗?请帮忙......
答案 0 :(得分:0)
再也无法绘制锁定屏幕和其他重要的UI元素(状态栏等),Google在Android O中删除了此功能。