Code example for WebView: Displaying web pages

Methods: getUrlloadUrl

0
  private String executeJavascriptInWebView(final String script) {
    result = null;
    resultReady = false;
    ServerInstrumentation.getInstance().runOnUiThread(new Runnable() {
      public void run() { 
        if (webview.getUrl() == null) {
          return; 
        } 
        webview.loadUrl("javascript:" + script);
      } 
    }); 
    long timeout =
        System.currentTimeMillis() + serverInstrumentation.getAndroidWait().getTimeoutInMillis();
    synchronized (syncObject) {
      while (!resultReady && (System.currentTimeMillis() < timeout)) {
        try { 
          syncObject.wait(2000);
        } catch (InterruptedException e) {
          throw new SelendroidException(e);
        } 
      }