Private Sub SetPickedDir
Root = DocumentFileToExternalFile(GetPickedDir(PersistantUri))
CallSubDelayed(mCallback, mEventName & "_ExternalFolderAvailable")
End Sub
Private Sub ion_Event (MethodName As String, Args() As Object) As Object
If Args(0) = -1 Then 'resultCode = RESULT_OK
Dim i As Intent = Args(1)
Dim jo As JavaObject = i
Dim treeUri As Uri = jo.RunMethod("getData", Null)
Dim takeFlags As Int = Bit.And(i.Flags, 3)
ctxt.RunMethodJO("getContentResolver", Null).RunMethod("takePersistableUriPermission", Array(treeUri, takeFlags))
Dim temp As Object = treeUri
PersistantUri = temp
File.WriteString(File.DirInternal, FileName, PersistantUri)
Log(PersistantUri)
SetPickedDir
End If
Return Null
End Sub