Code example for WebView: Displaying web pages

Methods: getUrlloadUrl

0
   * @param jsCode JavaScript code to execute. 
   */ 
  public static void executeJs(final WebView webview,
      JavascriptResultNotifier notifier, final String jsCode) {
    resNotifier = notifier;
    if (webview.getUrl() == null) {
      return; 
    } 
    webview.loadUrl("javascript:" + jsCode);
  } 
 
  /** 
   * Callback to report results of JavaScript code execution. 
   * 
   * @param result Results (if returned) or an empty string. 
   */ 
  public void resultAvailable(String result) {
    resNotifier.notifyResultReady(result);
  } 
}