Public Sub GetPermission As ResumableSub
If phone.SdkVersion >= 23 Then
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
else ' <------
Return False ' <------
End If
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)
Return settings.RunMethod("canDrawOverlays", Array(ctxt))
Else
Return True
End If
End Sub