Android Question Copy a file and change it's extension (example: from .bat to .txt)

alvin1929

Member
Thank you for your suggestions. I am currently doing the file.copy and file.delete method. I m using the Content chooser with the file.copy, I might be missing something?

Here's my code

B4X:
Sub Button1_Click

    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result Then
    Dim cc As ContentChooser
    cc.Initialize("cc")
    cc.Show("application/bat", "Choose bat ")
    End If
End Sub

Sub cc_Result (Success As Boolean, Dir As String, filename As String)
    If Success Then
    File.Copy(Dir,filename,Dir, "new.txt")
    End If
End Sub

log says
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
 

alvin1929

Member
I miss this line, rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)

The code works now and decided to transfer the file in File.DirDefaultExternal
 
Top