Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetWebViewClient, setFocusable, setHorizontalScrollBarEnabled

0
			     "正在读取网络数据...", Toast.LENGTH_LONG);
		toast.setGravity(Gravity.CENTER, 0, 0);
		toast.show();
       	 
       	webView = (WebView)findViewById(R.id.newsWebView);
       	webView.getSettings().setJavaScriptEnabled(true);
       	webView.setHorizontalScrollBarEnabled(false);
       	webView.loadUrl(trans.getString("link"));
       	webView.setWebViewClient(new ReadNewsWebViewClient());
       	webView.setFocusable(false);
       	 
       	 
       	 
       	 
       	 
	} 
	 
	private class ReadNewsWebViewClient extends WebViewClient{
 
		public boolean shouldOverrideUrlLoading(WebView view, String url) {
			// TODO Auto-generated method stub