Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetWebChromeClientsetWebViewClient

0
        .build(); 
 
        requestToken = service.getRequestToken();
        final String authURL = service.getAuthorizationUrl(requestToken);
         
        webView.loadUrl(authURL);
    } 
     
    @Override 
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        // Check if the key event was the BACK key and if there's history 
        if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) {
            webView.goBack();
            return true; 
        } 
        return super.onKeyDown(keyCode, event);
    } 
     
    private void initWebView() { 
    	webView = new WebView(this);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.setWebViewClient(new CustomWebViewClient());
        webView.setWebChromeClient(new WebChromeClient() {
        	@Override 
        	public void onProgressChanged(WebView view, int newProgress) {
        		 LinkedInOAuthActivity.this.setProgress(newProgress * 100);
        	} 
        }); 
Contextual code suggestions in your IDE  Get Codota for Java