Code example for WebView

Methods: setWebChromeClient, getClass

0
	public CalabashChromeClient(final WebView webView) {
		this.webView = webView;
		this.scriptFuture = new WebFuture(webView);
		if (Build.VERSION.SDK_INT < 16) { // jelly bean
			try { 
				Method methodGetConfiguration = webView.getClass().getMethod(
						"getWebChromeClient"); 
				mWebChromeClient = (WebChromeClient) methodGetConfiguration
						.invoke(webView);
			} catch (Exception e) {
				throw new RuntimeException(e);
			} 
		} 
 
        if ( Looper.getMainLooper().getThread() == Thread.currentThread()) {
            webView.setWebChromeClient(this);
        } else { 
            InstrumentationBackend.instrumentation.runOnMainSync(new Runnable() {
                @Override 
                public void run() { 
                    webView.setWebChromeClient(CalabashChromeClient.this);