I have a very simple Phonegap application that loads an external website:
<script type="text/javascript" src="cordova.js"></script>
<script>
function onDeviceReady() {
if (navigator.connection.type == Connection.NONE) {
navigator.notification.alert('An internet connection is required to continue');
} else {
window.location = "http://example.com";
}
}
document.addEventListener("deviceready", onDeviceReady, false);
</script>
When I run it it all works properly and loads the external site. If I switch to a different app and then click the icon to run it (in Android) it switches back to the already running application with no issues.
The problem started occurring when I switched from my testing environment to my production one and switched it to go to an . Now, when I click on the icon it restarts the application instead of simply switching back to the application already running.https
version
Is there any way to control whether clicking on the icon reloads the application or simply switches back to the already running application?
EDIT:
Okay, I thought the only difference was changing the "http" to "https", but apparently I also did an upgrade of "phonegap". I tried switching it back to "http" and it's still doing the same wrong thing. Is there any way to control this? I'm currently running 6.5.2 and I think the proper functionality was with 6.5.0 .
EDIT 2:
Alright... It seems that it's somewhat random. I have it running the latest and using "https" and it sometimes reloads and sometimes doesn't.