Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetScrollBarStylesetWebViewClient, requestFocus, setOnTouchListener, setScrollbarFadingEnabled, setVisibility

0
	} 
 
	@SuppressWarnings("deprecation") 
	private void drawUI(){ 
		if (webView != null) {
			WebSettings settings = webView.getSettings();
			webView.setVisibility(View.GONE);
			webView.getSettings().setSupportZoom(true);
			webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
			webView.setScrollbarFadingEnabled(true);
			webView.getSettings().setLoadsImagesAutomatically(true);
			webView.requestFocus(View.FOCUS_DOWN);
			webView.setOnTouchListener(new View.OnTouchListener() {
		        @Override 
		        public boolean onTouch(View v, MotionEvent event) {
		            switch (event.getAction()) {
		                case MotionEvent.ACTION_DOWN:
		                case MotionEvent.ACTION_UP:
		                    if (!v.hasFocus()) {
		                        v.requestFocus();
		                    } 
		                    break; 
		            } 
		            return false; 
		        } 
		    }); 
			settings.setJavaScriptEnabled(true);
			settings.setPluginsEnabled(true);
	        settings.setAllowFileAccess(true);
			settings.setJavaScriptCanOpenWindowsAutomatically(true);
			settings.setSupportMultipleWindows(true);
			 
			webView.setWebViewClient(new AppStoreVnViewClient());
			webView.loadUrl(url);
		} 
	} 
 
	@Override 
	protected void onRestoreInstanceState(Bundle savedInstanceState) {