Code example for WebView: Displaying web pages

Methods: canGoBackcanGoForward, x 1

0
 
			// Disable stop button if page finishes loading // 
			j_stopButt.setEnabled(false);
 
			// Inject Javascript into HTML page // 
			j_web.loadUrl("javascript:window.HTMLOUT.showHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');");
 
			// If history exists, enable prev/next buttons // 
			j_backButt.setEnabled(j_web.canGoBack());
			j_fwdButt.setEnabled(j_web.canGoForward());
		} 
 
		@Override 
		public boolean shouldOverrideUrlLoading(WebView view, String url) {
			view.loadUrl(url);
			return true; 
		} 
	} 
 
	@Override 
	public void onClick(View arg0) {