Nic Clark
Nic Clark

Reputation: 33

Phonegap app restarts every time I open the app. Any suggestions to return to same page?

I'm not sure if "restart" is the appropriate phrase, but here is my scenario. I login to the app, browse a couple pages, then exit by pressing the home key. If I look at my current tasks running I see that the app continues to run (which it should). I then click the app icon to return to the app, but the splash screens comes up and then I'm taken back to the login page. This should go back to the page I was last on. What is interesting is that if I press the hardware back key from the login page I am directed to the page from my last session (where it should go).

What I know:

  1. Only one instance of the app runs (this is correct)
  2. The app continues to run in the background (this is correct)
  3. I have tried adding preference name="AndroidLaunchMode" value="singleTop" in the config.xml to no avail

Am I missing something?

Upvotes: 1

Views: 386

Answers (1)

Roope Hakulinen
Roope Hakulinen

Reputation: 7405

For iOS (at least) there exists this configuration option

<preference name="exit-on-suspend" value="false" />

which should control the suspension on home key press.

For Android my apps work just like what you seem to want, so don't really know how to help with that. Only thing I can tell is that on Android as far as I know, the back button should kill the app whilst pressing the home button should cache it and take it of from memory.

Upvotes: 1

Related Questions