The
[B4X] TextEditor - Save and load external files example show how you can use an other location. However its hard to get the used directory location and used filename. Only with the Load function the full combined directory and file string can be grabbed with the help of the
Apache StringUtils library and the following modification of the load function of the FilerHandler:
[CODE lang="b4x" title="Updated Load function" highlight="6-13"]Public Sub Load As ResumableSub
Dim cc As ContentChooser
cc.Initialize("cc")
cc.Show("text/*", "Choose text file")
Wait For CC_Result (Success As Boolean, Dir As String, FileName As String)
' --- https://www.b4x.com/android/forum/threads/90-string-manipulation-methods.73564/ ---
Dim APSU As ApacheSU
Dim FileNameStr As String = APSU.SubstringAfterLast(FileName, "%2F")
Dim DirStr As String = APSU.SubstringBeforeLast(FileName, "%2F")
Log(DirStr)
Log(FileNameStr)
Dim res As LoadResult = CreateLoadResult(Success, Dir, FileName)
If res.Success Then ExtractInformationFromURI(res.FileName, res)
Return res
End Sub[/CODE]
After changing the DirStr and FileNameStr to a global varaible you can test both values and skip the selection for the directory and filename.