-
public class OverlayPermissionProvides queries and actions that are required for dealing with the user permission to display window overlays. Attempting to display a window overlay without permission results in a crash.
-
-
Method Summary
Modifier and Type Method Description static booleanhasRuntimePermissionToDrawOverlay(@NonNull() Context context)Does this app have permission to display Views as an overlay above all other apps? static IntentcreateIntentToRequestOverlayPermission(@NonNull() Context context)Starting with Android M, a runtime permission is required to be able to display UI elementsas an overlay above all other apps. -
-
Method Detail
-
hasRuntimePermissionToDrawOverlay
static boolean hasRuntimePermissionToDrawOverlay(@NonNull() Context context)
Does this app have permission to display Views as an overlay above all other apps?
- Parameters:
context- context
-
createIntentToRequestOverlayPermission
@NonNull() static Intent createIntentToRequestOverlayPermission(@NonNull() Context context)
Starting with Android M, a runtime permission is required to be able to display UI elementsas an overlay above all other apps. This method creates and returns an Intent that promptsthe user for this permission.
- Parameters:
context- context
-
-
-
-