@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt("url_type", urlType.getCode()); // Save the state of the WebView mainWebView.saveState(outState); }