Code example for WebView

Methods: canGoBackclearCacheclearFormDataclearHistorygoBack

0
		super.onConfigurationChanged(newConfig);
	} 
 
	@Override 
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
			mWebView.goBack();
			return true; 
		} else if ((keyCode == KeyEvent.KEYCODE_BACK)
				&& mWebView.canGoBack() == false) {
			mWebView.clearHistory();
			mWebView.clearFormData();
			mWebView.clearCache(true);
			super.onDestroy(); 
			finish();
		} else if (keyCode == KeyEvent.KEYCODE_HOME) {
			mWebView.clearHistory();
			mWebView.clearFormData();
			mWebView.clearCache(true);
			super.onDestroy(); 
			finish();
		} 
		return super.onKeyDown(keyCode, event);
	} 
Contextual code suggestions in your IDE  Get Codota for Java