Android permission denied for window type 2010 in Marshmallow or higher

前端 未结 4 1503
醉酒成梦
醉酒成梦 2021-01-19 06:22

I am try to make Chathead type overly draw via Android Service on my app like bellow image.

This chat head app works on An

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-19 07:16

    it looks like your addView() method is failing. I've fixed that issue (in some cases) using WindowManager.LayoutParams.TYPE_PHONE for Android SDK under 8.0 and WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY for 8.0 and above. You could add some automatic selection in order to grant major compatibility (depending on the active SDK platform) but since Google Play doesn't allows APKs under 8.0, it's clearly unnecessary. Hope it helps.

提交回复
热议问题