We are constructing a mobile web application using PhoneGap and JQuery mobile. Here is our flow:
Gateway -> Login -> LoadDetails
-> LoadDetails
From LoadDetails various other workflows are executed at the end of which the user is redirected back to LoadDetails with the information updated accordingly.
Our goal in Android is for LoadDetails to be the topmost page in the application. Once a workflow is completed, hitting back on LoadDetails should exit the app.
We have multiple ways of getting to LoadDetails, i have listed the two most common. Obviously, if the user logged in successfully and landed on LoadDetails we would not want the back button to return them to login.
Needs:
– ability to remove pages from the stack
Thoughts?
On your LoadDetails page you want to register a backbutton event listener. In the method that handles the event you’ll want to call navigator.app.exitApp() to quit the application. Something like this: