Public Sub GetDrawOverPermission As ResumableSub
Try
Dim settings As JavaObject
settings.InitializeStatic("android.provider.Settings")
Dim ctxt As JavaObject
ctxt.InitializeContext
If settings.RunMethod("canDrawOverlays", Array(ctxt)) = True Then
Return True
End If
Msgbox2Async($"The "display over other apps" permission is required on Android Q+ devices in order to allow B4A-Bridge to start other apps while in the background."$, "", "OK", "", "", Null, False)
Wait For Msgbox_Result (Result As Int)
Dim i As Intent
i.Initialize("android.settings.action.MANAGE_OVERLAY_PERMISSION", "package:" & Application.PackageName)
StartActivityForResult(i)
Wait For ion_Event (MethodName As String, Args() As Object)
Catch
Log(LastException)
End Try
Return True
End Sub