Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetWebViewClient, setVisibility

0
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.facebook);
		fProgress = (ProgressBar) findViewById(R.id.fprogressbar);
		mWebView = (WebView) findViewById(R.id.webview);
		mWebView.setVisibility(View.INVISIBLE);
		mWebView.getSettings().setJavaScriptEnabled(true);
		mWebView.loadUrl(url);
		mWebView.setWebViewClient(new WebViewClient() {
			public void onPageFinished(WebView view, String url) {
				fProgress.setVisibility(View.GONE);
				mWebView.setVisibility(View.VISIBLE);
			} 
		}); 
	} 
	 
	private Handler handler = new Handler() {
		@Override 
		public void  handleMessage(Message msg) { 
			fProgress.setVisibility(View.GONE); 
		}};