B4J Question B4J Thread

Firpas

Active Member
Licensed User
Longtime User
Hi to everybody,

I am trying to copy files with File.Copy starting a background process with Threading library but i recibe an error "Exception : argument type mismatch".

Here is my code:

B4X:
If Thread1.Start(Me, "CopyFile", Array As String(sPath, sFile, tPath, tFile)) Then
        Timer1.Enabled = True
    End If

Sub CopyFile(Path1 As String, File1 As String, Path2 As String, File2 As String)
    File.Copy(Path1, File1, Path2, File2)
End Sub

Sub Thread1_Ended(endedOK As Boolean, error As String) 'The thread has terminated. If endedOK is False error holds the reason for failure
    Timer1.Enabled = False
    If endedOK Then
        fx.Msgbox(MainForm, "One file copied Ok", "FileCopy")
    Else
        fx.Msgbox(MainForm, error, "Oooops")
        Log(error)
    End If
End Sub

Attached there is a project example

Thanks in advance
 

Attachments

  • CopyTest.zip
    2.9 KB · Views: 334

Firpas

Active Member
Licensed User
Longtime User
As you can see in the attached images i am working with te same java version.
I don´t understand
 

Attachments

  • nuevo-1.png
    32.9 KB · Views: 347
  • nuevo-2.png
    19.5 KB · Views: 378
Upvote 0
Top