Http2Utils2 - Sending 2 Jobs
Dear all,
Just started using Basic4Android and so far so good. At the price, its a steal.
I have an app that
a) Allows the user to search a web database of items
b) Displays the results, a few fields, in a list view
All of this works fine with the httputils2.
When the User clicks on one of the items in the list view it takes the ID, queries for more details from the db along with a url of the image (from Amazon's API). This works however it only executes after end sub.
What I want to do is download the URL to cache and show it with the other details in a msgbox2 however the hc_success doesnt get triggered until the sub is done
Even if I try to call it in the JobDone its a little better but it doesnt fully run either.
I think this may be due to the CallSubdealyed2 not sure.
How do I have the click event run two http jobs and show the message box?
Dear all,
Just started using Basic4Android and so far so good. At the price, its a steal.
I have an app that
a) Allows the user to search a web database of items
b) Displays the results, a few fields, in a list view
All of this works fine with the httputils2.
When the User clicks on one of the items in the list view it takes the ID, queries for more details from the db along with a url of the image (from Amazon's API). This works however it only executes after end sub.
What I want to do is download the URL to cache and show it with the other details in a msgbox2 however the hc_success doesnt get triggered until the sub is done
Even if I try to call it in the JobDone its a little better but it doesnt fully run either.
I think this may be due to the CallSubdealyed2 not sure.
How do I have the click event run two http jobs and show the message box?
B4X:
Sub ListView1_ItemClick (Position As Int, Value As Object)
Dim tl As TwoLines
Dim intPipePos As Int
Dim id As Int
tl = Value
intPipePos = tl.Second.LastIndexOf(":")
id = tl.Second.SubString(intPipePos + 1)
ExecuteRemoteQueryWithAmazon("SELECT id, insertdate, comments, isbn, handle, price, title, author, course_id, handle FROM `books` WHERE id=" & id, "Job2")
DownloadImageToCache(url,"Job3")'This requires the URL from the above but the above is skipped and end sub is run
'then I will download the image to chace and display iti n a msgbox2 as a bitmap
End Sub
Sub DownloadImageToCache(Query As String,TaskId As String)
job3.Initialize(TaskId, Me)
job3.Download(Query)
End Sub
Last edited: