WebView Data Caching (Android)
- I am loading HTML data into WebView using loadDataWithBaseURL
- Do it one more time
-
Run the following code and instead of returning to the first page, all applications are terminated. What am I doing wrong here?
public boolean onKeyDown(final int keyCode, final KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && this.browser.canGoBack()) { this.browser.goBack(); return true; } return super.onKeyDown(keyCode, event);
}
Also - is it possible for the WebView cache to survive Activity # onStop? Basically - if I close the app and reopen it - I want the WebView to display the last data that was loaded, currently - I get a blank screen and then have to reload the same data again
+2
source to share