Android Question Download2

Almora

Well-Known Member
Licensed User
Longtime User
hi..
I want to display the image. but I get the error. Where am I doing wrong.

error: incompatible types: String[] cannot be converted to ImageViewWrapper



Code:
DownloadImage("https://website.com/1.x/?lang=en_US", _
     Array As String("ll", EditText2.Text & "," & EditText1.Text, "z",17,"size", 450 & "," & 450,"l","sat",ImageView1))



Code:
Sub DownloadImage(Link As String, iv As ImageView)
    Dim j As HttpJob
    j.Initialize("",Me)
    
    j.Download2(Link, _
    Array As String("key1", "value1", "key2", "value2"))
    Wait For (j) JobDone (j As HttpJob)
    If j.Success Then
        iv.Bitmap=j.GetBitmap
    End If
    j.Release
End Sub
 
what was the servers response? i guess that it is returning a string not images
Code:
log(j.GetString)
 
Upvote 0
the second argument in DownloadImage is imageview but u gave it a string array.
inside the DownloadImage there is a dummy array that u would replace by function argument.
 
Upvote 0
DownloadImage(1, 2, 3) this call looks wrong
Sub DownloadImage(1,2)
 
Upvote 0
just remove the second argument in the sub,
Code:
DownloadImage("https://website.com/1.x/?lang=en_US")
Sub DownloadImage(Link As String)
 
Upvote 0
this is wrong, the imageview is part of the string array :)
("ll", EditText2.Text & "," & EditText1.Text, "z",17,"size", 450 & "," & 450,"l","sat",ImageView1)
 
Upvote 0
try this

Code:
DownloadImage("https://website.com/1.x/",ImageView1)

Sub DownloadImage(Link As String, iv As ImageView)
    Dim j As HttpJob
    j.Initialize("",Me)
   
    j.Download2(Link, _
    Array As String("lang","en_US","ll", EditText2.Text & "," & EditText1.Text, "z",17,"size", 450 & "," & 450,"l","sat"))
    Wait For (j) JobDone (j As HttpJob)
    If j.Success Then
        iv.Bitmap=j.GetBitmap
    End If
    j.Release
End Sub
 
Last edited:
Upvote 0
lang=en_US is also a parameter for this string array.
"lang","en_US"

the ? in url means here starts parameters and there are separated by &
its done in Download2 for you.
 
Upvote 0
Back
Top