If MLfiles does not exist, PERMISSION_WRITE_EXTERNAL_STORAGE always returns False.
B4A Version 11.80
B4A Version 11.80
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Dim LocRP As RuntimePermissions
Dim LocUnusedML As MLfiles '***If the LocUnusedML declaration variable is removed, the result is always False.***
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim PhoneVer As Phone
If PhoneVer.SdkVersion >= 23 Then '23:Android v6.0
If LocRP.Check(LocRP.PERMISSION_WRITE_EXTERNAL_STORAGE) = False Then
LocRP.CheckAndRequest(LocRP.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
xui.MsgboxAsync(Result,"Result:")
'***If the LocUnusedML declaration variable is removed, the result is always False.***
End If
End If
Activity.LoadLayout("Layout")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
ExitApplication
End Sub