jQuery Mobile programmatically reinitialise/restart app

For a full solution, I think you are out of luck.

iOS definitely will *NOT allow the programatic killing of an app, let alone the programatic starting one.

Android does allow the killing of an app. Though undocumented (that I could find) you can use

navigator.app.exitApp();

to kill the current app.

However, you still cant re-start it programaticly.

I think your best bet will be to write the code to reset the variables and local storage/DB (if used). Then reload the index page via document.location.href = 'index.html?var=xxx'; where xxx = the current timestamp. Placing the timestamp at the end will ensure that it pulls a non-cached version of the page.

*Edit: Added not to my statement about Apple allowing app killing as it should have been.


Try, document.location.href

document.location.href = 'index.html';

Have you tried to reload app?

The reload() method is used to reload the current document.
The reload() method does the same as the reload button in your browser.
By default, the reload() method reloads from the cache, but by you can force the the reload to get the page from server by setting the forceGet parameter to true.

location.reload();