Code example for WebView: Displaying web pages

Methods: canGoBackcanGoForward, x 1

0
			// Disable stop button if page finishes loading // 
			j_stopButt.setEnabled(false);
 
			// Use the interface to inject html 
			// j_web.loadUrl("file:///android_asset/html/index.html"); 
			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; 
		} 
	} 
 
	/** 
	 * Used for calling 'alert' from Javascript. Also good for debugging the