title: How to extract string from WebView in Android
body: <p>I want to extract string from WebView, I used</p>
  
  <pre><code>class MyJavaScriptInterface
  {
  private Context context;
  private TextView textView;
  
  public MyJavaScriptInterface(Context context, TextView textView) {
       this.context = context;
       this.textView = textView;
  }
  public void processContent(String aContent){
  final String content = aContent;
  textView.post(new Runnable(){
  
       @Override
       public void run() {
             textView.setText(content);
       }
   });
  }
  }
  webView.getSettings().setJavaScriptEnabled(true);
  webView.addJavascriptInterface(new MyJavaScriptInterface(getActivity(), contentView), "INTERFACE");
              webView.setWebViewClient(new WebViewClient() {
  
                  @Override
                  public void onPageFinished(WebView view, String url) {
                      super.onPageFinished(view, url);
                      view.loadUrl("javascript:window.INTERFACE.processContent(document.getElementsByTagName('body')[0].innerText);");
                  }
              });
  webView.loadUrl(url);
  </code></pre>
  
  <p>but in my processContent there is no String that pass in the textview.</p>
  
  <p>Thanks in advance!</p>