Phonegap Android application exiting - but not really - when home button is pressed
Posted
by
Lucas T
on Stack Overflow
See other posts from Stack Overflow
or by Lucas T
Published on 2012-04-12T11:15:46Z
Indexed on
2012/04/12
11:29 UTC
Read the original article
Hit count: 212
I have created an Phonegap 1.5/Android application.
My client reports that, when he leaves the app using the Home button, and then relaunches it using the app icon, the app relaunches from the start instead of resuming. However, when he holds the home button, the app appears in the running apps, and when he accesses the app through this menu, the app resumes in the expected way.
I thought this could be linked to the app being automatically closed by the OS due to a lack of memory, but if that was the case the app shouldn't appear in the running apps.
I could not reproduce the bug on my Sony Ericsson XPERIA with Android 2.3.4, the client has experienced this behaviour on a Motorola Defy and on another phone (i'll add the reference of the other phone and the OS versions as soon as I get them).
The initialization process of the app is declared this way :
window.addEventListener('load', function(){
document.addEventListener('deviceready', _onDeviceReady, false);
}, false);
Could this be fixed by attaching the processes to other events (although I doubt it, the app really seems to be relaunched from the start) ?
Is there a declaration to make in the Android Manifest to prevent this behavior ?
Is that a known bug in some Android phones/versions ?
© Stack Overflow or respective owner