Android Question FileHandler determine file name for FileCopy

so27

Active Member
Licensed User
Longtime User
Hi everybody,

I am trying to copy an existing ZIP file (located in File.DirInternal) to another location using the FileHandler (SDK 30). I use the FileHandler to select the directory and the file name. My code looks like this:

B4X:
        Dim intent As Intent
        intent.Initialize("android.intent.action.CREATE_DOCUMENT", "")
        intent.AddCategory("android.intent.category.OPENABLE")
        intent.PutExtra("android.intent.extra.TITLE", "DaSi_.zip")
        intent.SetType("application/zip")
        StartActivityForResult(intent)
      
        Wait For ion_Event (MethodName As String, Args() As Object)
        If -1 = Args(0) Then 'resultCode = RESULT_OK

            'Here then should follow:
            File.Copy..... to the selected directory (and Filename).

        End If

How can I use FileHandler to copy my ZIP file to the selected directory. I don't quite understand it yet.
 

Attachments

  • 2021-11-08_14h47_25.png
    2021-11-08_14h47_25.png
    253.5 KB · Views: 141
Top