M Massimiliano Member Licensed User Longtime User Mar 7, 2016 #1 Hi, I have a problem that is driving me crazy my app has many activities (main and others). All is working fine until I activate some code that make use of httputils. The httpjobs work fine (I receive what expected from the server), but from time to time the foreground activity "X" closes (userclosed = false in the log) and it's shown the main activity. Exiting from the main activity, brings up the "X" activity closed. So, my app seems to be crazy. Any hint? Thank you
Hi, I have a problem that is driving me crazy my app has many activities (main and others). All is working fine until I activate some code that make use of httputils. The httpjobs work fine (I receive what expected from the server), but from time to time the foreground activity "X" closes (userclosed = false in the log) and it's shown the main activity. Exiting from the main activity, brings up the "X" activity closed. So, my app seems to be crazy. Any hint? Thank you
DonManfred Expert Licensed User Longtime User Mar 7, 2016 #2 Use a Service where you did all the httpjob work. In JobDone you then can delegate the answer to the right (actuall running) activity. Upvote 0
Use a Service where you did all the httpjob work. In JobDone you then can delegate the answer to the right (actuall running) activity.
M Massimiliano Member Licensed User Longtime User Mar 7, 2016 #3 Thank you Don! I think that this solution requires a lot of effort - over the few lines inside the activities (dim httpjob, post and sub jobdone) sigh there would be nothing more easy? Upvote 0
Thank you Don! I think that this solution requires a lot of effort - over the few lines inside the activities (dim httpjob, post and sub jobdone) sigh there would be nothing more easy?
Erel B4X founder Staff member Licensed User Longtime User Mar 7, 2016 #4 As Don wrote you need to use a service. You can use the starter service for this. Otherwise the target activity will be started when JobDone is raised. Upvote 0
As Don wrote you need to use a service. You can use the starter service for this. Otherwise the target activity will be started when JobDone is raised.
M Massimiliano Member Licensed User Longtime User Mar 7, 2016 #5 Erel said: As Don wrote you need to use a service. You can use the starter service for this. Otherwise the target activity will be started when JobDone is raised. Click to expand... Thank you Erel, i'm using starter service from v5.5, thinking that my problem was related to some global variables as described in other threads. Now i've found that my problem it about httputils. Could you post a little example for making the job easier.... for me and (hope) other b4a friends? Thank you so much Erel! ;-) Massimiliano Upvote 0
Erel said: As Don wrote you need to use a service. You can use the starter service for this. Otherwise the target activity will be started when JobDone is raised. Click to expand... Thank you Erel, i'm using starter service from v5.5, thinking that my problem was related to some global variables as described in other threads. Now i've found that my problem it about httputils. Could you post a little example for making the job easier.... for me and (hope) other b4a friends? Thank you so much Erel! ;-) Massimiliano
DonManfred Expert Licensed User Longtime User Mar 7, 2016 #6 Search the forum. There are plenty of examples using httputils. Upvote 0