Android Question read file to intent.getData

kkkpe

Active Member
Licensed User
Longtime User
An intent returns this URI ,content://it.paytec.payddcmp/external_files/PayDdcmp/DataFile.txt, via the intent.getData() method.
How can I read the file and save it in my folder?
 

kkkpe

Active Member
Licensed User
Longtime User
RESOLVED.
B4X:
    Try
            Dim OutStr As OutputStream = File.OpenOutput(File.DirInternal,"test.evadts",False)
            Dim InStr As InputStream = File.OpenInput("ContentDir",uri)
            File.Copy2(InStr,OutStr)
            OutStr.Close
            Log(File.ReadString(File.DirInternal,"test.evadts"))
        Catch
            Log(LastException)
        End Try
 
Upvote 0
Top