Sub imgdownload_Click
Dim intresult As Int
intresult=Msgbox2("Download Report ??","Download","Yes","Cancell","",Null )
If intresult=DialogResponse.POSITIVE Then
ProgressDialogShow2("Please wait . . .", True)
Dim job As HttpJob
job.Initialize("pdf" , Me)
Dim S As String = Starter.serverAddress & "/report.php?usr=" & Starter.strusr & "&psw=" & Starter.strtoken
job.Download(s)
wait for (job) JobDone (job As HttpJob)
If job.Success = True Then
Try
Dim out As OutputStream=File.OpenOutput(Starter.shared ,"report.pdf", False )
File.Copy2(job.GetInputStream ,out)
out.Close
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW, app.CreateFileProviderUri(Starter.shared, "report.pdf"))
Intent1.SetType("application/pdf")
Intent1.Flags = 1
Try
StartActivity(Intent1)
Catch
MsgboxAsync("No App to display PDF files is installed on your device...." & CRLF & CRLF & LastException,"Error PDF")
End Try
Catch
Log(LastException)
End Try
End If
job.Release
ProgressDialogHide
End If
End Sub