Code example for WebView

Methods: addJavascriptInterfacegetSettingssetBackgroundColorsetHorizontalScrollbarOverlaysetVerticalScrollbarOverlaysetWebChromeClientsetWebViewClient, setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled

0
			} catch (IOException e) {
				e.printStackTrace();
			} 
		} 
 
		mWebView.setBackgroundColor(0xff000000);
		mWebView.setHorizontalScrollbarOverlay(true);
		mWebView.setVerticalScrollbarOverlay(true);
		mWebView.setHorizontalScrollBarEnabled(false);
		mWebView.setVerticalScrollBarEnabled(false);
 
		WebSettings webSettings = mWebView.getSettings();
		webSettings.setJavaScriptEnabled(true);
		webSettings.setPluginsEnabled(true);
		webSettings.setPluginState(PluginState.ON);
		webSettings.setUseWideViewPort(true);
 
		mWebView.addJavascriptInterface(new JsObj(), mJsObjId);
 
		mWebView.setWebChromeClient(new WebChromeClient() {
			@Override 
			public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
				Log.v(TAG, "onConsoleMessage msg:" + consoleMessage.message());
				return super.onConsoleMessage(consoleMessage);
			} 
		}); 
		mWebView.setWebViewClient(new WebViewClient() {
			@Override 
			public WebResourceResponse shouldInterceptRequest(WebView view,
					String url) {
				if (url.contains("/player_flv_js.swf")) {
					InputStream is;
Contextual code suggestions in your IDE  Get Codota for Java