Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetWebChromeClientsetWebViewClient

0
   
  @Override 
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_PROGRESS);
    webView = new WebView(this);
    setContentView(webView);
     
    cookieManager = CookieManager.getInstance();     
     
    initWebClient(); 
  } 
   
  private void initWebClient() { 
    webView.getSettings().setJavaScriptEnabled(true);
     
    webView.setWebChromeClient(new WebChromeClient() {
      public void onProgressChanged(WebView view, int progress) {
        // progress measures don't match web client progress measures 
        GoogleAuthActivity.this.setProgress(progress * 100);
      } 
    }); 
    webView.setWebViewClient(new GoogleAuthWebViewClient());
     
    webView.loadUrl(AUTH_URL);
  } 
   
  private class GoogleAuthWebViewClient extends WebViewClient {
 
    @Override