Please, how to save the image in the gallery after download?
My code:
My code:
B4X:
Sub DownloadImagem(url As String)
Dim Job As HttpJob
Job.Initialize("JobDownloadImg", Me)
Job.Download(url)
Wait For (Job) JobDone(Job As HttpJob)
If Job.Success = True Then
Dim out As OutputStream = File.OpenOutput(File.DirInternal, "teste.jpg", False)
File.Copy2(Job.GetInputStream, out)
out.Close
Log("sucess")
Else
Log("Erro no Job: " & Job.ErrorMessage)
pnlPainel.Visible=True
ToastMessageShow("Erro ao baixar imagem!", True)
End If
Job.Release
End Sub