SYSTEM_ALERT_WINDOW PERMISSION on API 26 not working as expected. Permission denied for window type 2002

后端 未结 7 1947
轮回少年
轮回少年 2020-12-08 21:17

I am using overlay permission to display certain information in my app. Running it on API 23 - 25 it works fine (asking for permission, granting, etc. according to

U

7条回答
  •  执念已碎
    2020-12-08 21:31

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
    WindowManager.LayoutParams.TYPE_SYSTEM_ERROR
    }
    else
    {
    WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
    }
    

    only change in this parameter of Window manager

提交回复
热议问题