B4J Question Wait For (Job) JobDone(Job as HttpJob) - stop user from pressing back key

mfstuart

Active Member
Licensed User
Longtime User
I have a login screen, that obviously, the user logins in to.
A successful login takes them to the 1st screen where JSON data is downloaded from an HttpJob and added to a CustomListView. This takes about 2-3 seconds to complete.
From there, the user can touch a row in the CLV and it then takes them to the 2nd screen, showing them data related to the 1st screen.

If they press the back button 2 times from the 2nd screen, it takes them back to the Login screen, but it then it takes them back to the 1st screen where the JSON download has to complete. (this HttpJob call is made from the 1st screen Activity_Resume handler)
Not what the user expected.

I show a ProgressBar Indeterminate on the 1st screen, but they can ignore that and press the back button again anyway.
Either way, the 1st screen's download has to be completed with the JSON data, and populate the CLV.

This doesn't seem like a nice User Experience.

What can be done to have the HttpJob to complete before any user interaction can take place?

ps: a little long I know, but it's a little complicated to describe.

Thanx,
Mark Stuart
 

Daica

Active Member
Licensed User
Are you using B4X Pages? You can do something like ShowPageAndRemovePreviousPages to remove the login page once they're logged in.
You can also put some code into the Activity_KeyPress or B4XPage_CloseRequest to ignore the back button if the download isn't done yet.

Just a couple ideas
 
Upvote 0

mfstuart

Active Member
Licensed User
Longtime User
Are you using B4X Pages? You can do something like ShowPageAndRemovePreviousPages to remove the login page once they're logged in.
You can also put some code into the Activity_KeyPress or B4XPage_CloseRequest to ignore the back button if the download isn't done yet.

Just a couple ideas
No, just using the UI project type.
But I will give your other suggestions a try.

Thank you
 
Upvote 0
Top