xytz86
New Member
I want to get the file path from contentchooser so that I can read the file content using "file. Openinput()". When the return value of filename is URI.
I use Huawei mobile phone test to return the URI as follows"content://com.android.providers.downloads.documents/document/msf%3A1445720",
and another mobile phone test returns the real path as follows"/storage/emulated/0/Android/data/com.tencent.mobileqq/Tencent/QQfile_recv/*****.TXT"
please tell me what to do.
I use Huawei mobile phone test to return the URI as follows"content://com.android.providers.downloads.documents/document/msf%3A1445720",
and another mobile phone test returns the real path as follows"/storage/emulated/0/Android/data/com.tencent.mobileqq/Tencent/QQfile_recv/*****.TXT"
B4X:
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)
Dim res As LoadResult = CreateLoadResult(FileName)
Dim tr As TextReader
tr.Initialize(File.OpenInput(res.FileName,res.Dir))
Dim line As String
Do While line <> Null
line = tr.ReadLine
If line<> Null Then
WriteHrtDB(line)
End If
Loop
End If
please tell me what to do.