Code example for WebView: Displaying web pages

Methods: addJavascriptInterfacegetSettingsloadUrlsetWebViewClient

0
            service = (Service) getIntent().getSerializableExtra(SERVICE);
        } 
        String targetUrl = getIntent().getStringExtra(URL);
        session = Session.getInstance(this);
        //service = getIntent().getStringExtra("service"); 
        wv.getSettings().setJavaScriptEnabled(true);
        wv.addJavascriptInterface(jsInterface, "MatjiExternalService");
 
        wv.setWebViewClient(new WebViewClient() {
            @Override 
            public void onPageFinished(WebView view, String url) {
                Log.d(TAG, url);
                wv.loadUrl("javascript:window.MatjiExternalService.getOAuthResult(document.getElementById('yummystory_result_code').value);");
            } 
        }); 
        wv.loadUrl(targetUrl);
    } 
 
    private void initValues() { 
        wv = new WebView(this);
        jsInterface = new JavaScriptInterface();
 
    } 
 
    class JavaScriptInterface {