Android: permission denied for window type 2038 using TYPE_APPLICATION_OVERLAY

前端 未结 6 1636
礼貌的吻别
礼貌的吻别 2020-12-10 02:28

I trying to create a view that is above other applications:

WindowManager.LayoutParams paramsDirectorView = new WindowManager.LayoutParams(
        WindowMan         


        
6条回答
  •  不知归路
    2020-12-10 02:42

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

提交回复
热议问题