Sub Activity_Resume
Dim Permissions As List
Dim rp As RuntimePermissions
Wait For (CheckAndRequestNotificationPermission) Complete (HasPermission As Boolean)
If HasPermission = False Then
Log("no permission")
ToastMessageShow("no permission", True)
Return
End If
Permissions = Array("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH", "android.permission.BLUETOOTH_ADMIN","android.permission.BLUETOOTH_CONNECT", rp.PERMISSION_ACCESS_FINE_LOCATION,rp.PERMISSION_ACCESS_COARSE_LOCATION)
For Each per As String In Permissions
rp.CheckAndRequest(per)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
StartService(Tracker)
Else
ToastMessageShow("No permission...", True)
End If
Next
End Sub