Android System overlay window

后端 未结 6 779
忘掉有多难
忘掉有多难 2020-11-30 01:14

I\'m trying to create a system overlay. But I keep getting \"permission denied\". I\'m using SDK version 23.

My manifest file:



        
6条回答
  •  生来不讨喜
    2020-11-30 01:58

    First, there is no permission named SYSTEM_OVERLAY_WINDOW. It is SYSTEM_ALERT_WINDOW.

    Second, if your targetSdkVersion is 23 or higher, and you are running on Android 6.0+ devices, your app will not get this permission at the outset. Call Settings.canDrawOverlays() to see if you have the permission, and use ACTION_MANAGE_OVERLAY_PERMISSION to lead the user over to Settings if you do not.

提交回复
热议问题