Hi.
Using cordova android, when I hit the home button on the device, then later resume that app (while its still running in memory) the activity is restarted, and my content reloaded. I already make provision for this and am able to resume state within my app, but its ugly to say the least, and time consuming, and dare I say pointless, as the app is already there in background.
To combat this, I *was* using the AndroidManifest.xml activity setting to force a single instance
<activity android:launchMode="singleInstance" ...
and that worked great. If the process was still running in memory, the activity would simple be brought into foreground, no reloading of the web content occuring.
However, I later found that using this option, prevents cordova.camera.getPicture() from working, the camera always returns a cancelled state even when save is selected, and this wasn't due to lack of memory (no exceptions or stack traces). The only clue being the following line in logcat just after selecting Save in the camera (and therefore resuming my app)
W/ActivityManager( 1854): Activity is launching as a new task, so cancelling activity result.
So I was forced to take this singleInstance option out to get the camera code working again.
That is the background of the problem and where I am at. My question is:-
Is there a setting for android:launchMode (or other setting) that will bring an existing instance of the activity into foreground and not restart it?
Or is there a different way of launching the webview in the cordova client java code that would prevent this?