I'm just looking for some help please with httpUtills.
My problem is that I am calling 2 different HttpUtils.PostString from two different activities. The first one is fine from the first activity. I send the post string then it executes a script on my server and retrieves some data from a mySQL database. The results of this data is handled in the Sub JobDone.
Thats all fine but when i call HttpUtils.PostString with a different Job/Query the second time from a different activity the results go back to the JobDone Sub in the First activity which I dont want. I had put a second JobDone Sub in the second activity with code to handle the second set of results but it never goes near it.
Can I have only one JobDone Sub per project?
please help.
:sign0104:
:sign0163:
:sign0085:
:sign0085:
I'm just looking for some help please with httpUtills.
My problem is that I am calling 2 different HttpUtils.PostString from two different activities. The first one is fine from the first activity. I send the post string then it executes a script on my server and retrieves some data from a mySQL database. The results of this data is handled in the Sub JobDone.
Thats all fine but when i call HttpUtils.PostString with a different Job/Query the second time from a different activity the results go back to the JobDone Sub in the First activity which I dont want. I had put a second JobDone Sub in the second activity with code to handle the second set of results but it never goes near it.
Can I have only one JobDone Sub per project?
please help.
:sign0104:
:sign0163:
:sign0085:
:sign0085:
This is very easy to achieve, in your 2nd activity change
B4X:
HttpUtils.CallbackActivity = "Main"
from "Main" to your 2nd activity name. Then include in your 2nd activity JobDone sub to handle the return from HttpUtilis. Just make sure that main has completed all of the requests to HttpUtils before changing the CallBackActivity. I have done this in one of my apps and it works very well.
This is very easy to achieve, in your 2nd activity change
B4X:
HttpUtils.CallbackActivity = "Main"
from "Main" to your 2nd activity name. Then include in your 2nd activity JobDone sub to handle the return from HttpUtilis. Just make sure that main has completed all of the requests to HttpUtils before changing the CallBackActivity. I have done this in one of my apps and it works very well.
Hi Lagore,
Tried that and its not really working. Doing something really strange now.
Ive decided to go back to just using the httpClient as I was having no problems with it. I just find the HttpUtills very hard to work with. I also cannot find any documentation with it apart from a few small sample programs. If anyone could actually point me to where it is I would be grateful.
Thanks anyway for your help.