Nick McCulloch Member Licensed User Apr 7, 2019 #1 I have a test project (see attached) that asks for user name and password in the main Activity when the "Login" button is pressed. It does an HTTP GET to send the request and get a "Result " back. Is the Result is "True" then login was good so then display the next Activity Screen (eventsList). BUT, the program flow is as the attached flow screenshot. I dont know why it goes back to the Main Activity. What am I doing wrong? Also attached is the simple project. help !! Attachments Annotation 2019-04-07 153309.png 55.8 KB · Views: 425 maint.zip maint.zip 16.9 KB · Views: 397
I have a test project (see attached) that asks for user name and password in the main Activity when the "Login" button is pressed. It does an HTTP GET to send the request and get a "Result " back. Is the Result is "True" then login was good so then display the next Activity Screen (eventsList). BUT, the program flow is as the attached flow screenshot. I dont know why it goes back to the Main Activity. What am I doing wrong? Also attached is the simple project. help !!
Mashiane Expert Licensed User Longtime User Apr 7, 2019 #2 I'm confused about line 85, is that supposed to be the Result of the Resumable Sub? If so, then don't declare Result on Process_Globals. Check this video out, https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255570732 Your best bet will be, https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content And whilst my example here, https://www.b4x.com/android/forum/threads/mysql-data-to-webview-using-php.104274/ is not using waitfor, perhaps it might help to understand the sequencing of events of the app. Ta! Last edited: Apr 7, 2019 Upvote 0
I'm confused about line 85, is that supposed to be the Result of the Resumable Sub? If so, then don't declare Result on Process_Globals. Check this video out, https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255570732 Your best bet will be, https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content And whilst my example here, https://www.b4x.com/android/forum/threads/mysql-data-to-webview-using-php.104274/ is not using waitfor, perhaps it might help to understand the sequencing of events of the app. Ta!
Nick McCulloch Member Licensed User Apr 7, 2019 #3 Mashiane said: I'm confused about line 85, is that supposed to be the Result of the Resumable Sub? If so, then don't declare Result on Process_Globals. Check this video out, https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255570732 Your best bet will be, https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content Click to expand... "Result" is a string returned from the http response. I may have declared it in the wrong place , but, I dont think it should matter much to be honest. I moved it to "Globals" and it made no difference. Upvote 0
Mashiane said: I'm confused about line 85, is that supposed to be the Result of the Resumable Sub? If so, then don't declare Result on Process_Globals. Check this video out, https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255570732 Your best bet will be, https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content Click to expand... "Result" is a string returned from the http response. I may have declared it in the wrong place , but, I dont think it should matter much to be honest. I moved it to "Globals" and it made no difference.
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2019 #4 Make all network requests from the starter service or a class that was initialized in the starter service. Otherwise the activity will be resumed when the JobDone event is raised (it is related to the behavior of CallSubDelayed). Upvote 0
Make all network requests from the starter service or a class that was initialized in the starter service. Otherwise the activity will be resumed when the JobDone event is raised (it is related to the behavior of CallSubDelayed).