Reputation: 37154
Execute the following code and instead of going back to the 1st page - whole app exits. 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 WebView cache to survive Activity#onStop? Basically - if I close app and reopen - I want WebView to display last data that was loaded, currently - I'll get a blank screen and then have to reload same data again
Upvotes: 2
Views: 5748
Reputation: 100462
The problem is that load* does not create a new WebView, nor does it do anything special like create a history record, unfortunately.
You probably want call startActivity() and invoke a second activity for the second set of data.
Upvotes: 1