Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetScrollBarStylesetWebViewClient, setScrollbarFadingEnabled

0
 
		// Set the listener 
		startSecondActivityBtn.setOnClickListener(this);
 
		// Initialize the WebView 
		webView.getSettings().setSupportZoom(true);
		webView.getSettings().setBuiltInZoomControls(true);
		webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
		webView.setScrollbarFadingEnabled(true);
		webView.getSettings().setLoadsImagesAutomatically(true);
		webView.getSettings().setAppCacheMaxSize(1024 * 1024 * 8);
		webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
 
		// Load the URLs inside the WebView, not in the external web browser 
		webView.setWebViewClient(new WebViewClient());
 
		webView.loadUrl("http://10.132.64.207:9800/kcollection/list");
	} 
 
	@Override 
	protected void onDestroy() { 
		// Clear the cache (this clears the WebViews cache for the entire 
Experience pair programming with AI  Get Codota for Java