#additionaljar: com.android.support:support-v4
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private rp As RuntimePermissions
....
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
....
End Sub
Sub Activity_Create(FirstTime As Boolean)
....
Dim phone As Phone
Dim aver As Int
aver=phone.SdkVersion
If aver>22 Then
For Each permission As String In Array(rp.PERMISSION_READ_CONTACTS,rp.PERMISSION_CALL_PHONE,rp.PERMISSION_READ_PHONE_STATE)
rp.CheckAndRequest(permission)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result = False Then
Log(permission)
ToastMessageShow("No permissions - bye bye", True)
Activity.Finish
'ExitApplication
Return
End If
Next