Android Question Why Can not Work RuntimePermissions.GetSafeDirDefaultExternal In Android 13

Snger

New Member
RuntimePermissions.GetSafeDirDefaultExternal This feature does not work in Android 13+ why?
I hope to solve this problem soon
 

drgottjr

Expert
Licensed User
Longtime User
of course it works. when using the forum to report a problem or an error, it is important to include an example of your code and the log message you received when an exception is thrown. otherwise, we are just guessing what you did and what went wrong.

1) you need to include the runtimepermissions library
2) you need to declare an instance of that libary
3) you need to use any applicable methods correctly.

with the above in mind, you would, eg:

B4X:
dim rp as runtimepermissions   ' ***(after having selected runtimepermissions from the additional libraries tab in the ide) ***
dim safedefaultexternal as string = rp.GetSafeDirDefaultExternal("")
log("my safedefaultexternal folder is: " & safedefaultexternal)
' OR:
log(rp.GetSafeDirDefaultExternal(""))    ' if you were not going to save the location for later use and just wanted to know where it was
 
Upvote 1
Top