My Android app uses a webview and page flow is mainpage.html -> listpage.html -> detailpage.html From detail page, I launch the camera intent to take pictures and add the taken pictures in the detailpage body.
But in certain devices running on low memory, staying on the camera interface for long time kills my app in background, so when I return by confirming on the taken camera picture, my app starts reloads from mainpage.
I have taken care of the below:
- android:configChanges="orientation|keyboardHidden|screenSize" and android:screenOrientation="portrait" considering if orientation change in certain devices is causing this issue
- android:alwaysRetainTaskState="true"
- Saving and restoring via WebView.saveState() and .restoreState(). However these methods no longer save/restore the display data for this WebView
Are there alternative ways so that either:
- I make sure my app is not killed in background
- I can save and restore exactly the display data for my webview
NOTE: Solutions give at Does WebView saveState() preserve Javascript variables/environment? are not working for me. As mentioned in Webview saving state of page and https://code.google.com/p/android/issues/detail?id=69334, webview's display data is not stored/restored