title: Android WebView Jsoup
body: <p>I'm working on an app in which I would like to display my website but with less div elements.</p>
  
  <p>In this example code, I used the website of stackoverflow.com and have tried to hide the div class hmenus (buttons at the top of the main website).</p>
  
  <p>After running the code, I get a blank / white webview. What I have tried is to make the String html final and call it afterwards to set my final url for the webview.</p>
  
  <p>Code:</p>
  
  <pre><code>import android.app.Activity;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.webkit.WebChromeClient;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import org.jsoup.select.Elements;
  import java.io.File;
  
  public class MyCustomAsyncTask extends AsyncTask&lt;File, Void, String&gt; {
  @Override
  protected String doInBackground(File... params) {
  
      Document doc = Jsoup.connect("http://stackoverflow.com/").get();
      Elements ele = doc.select(":not(#hmenus)");        // -&gt;&gt;&gt;&gt;&gt; Jsoup html
      final String html = ele.toString();
  
  }}
  
  public class MainActivity extends Activity {
  
  
      private WebView WebView;
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          WebView = (WebView) findViewById(webView);
          WebView.setWebChromeClient(new WebChromeClient());
          WebView.getSettings().setJavaScriptEnabled(true);
          WebView.getSettings().setDomStorageEnabled(true);
  
          final String mime = "text/html";
          final String encoding = "utf-8";
          WebView.setWebViewClient(new WebViewClient() {
              @Override
              public void onPageFinished(WebView view, String url) {
  
                  // -&gt;&gt;&gt;&gt;&gt;&gt;   Change the website ---&gt;&gt;&gt; insert call html value
                  WebView.loadData(html, mime, encoding);
              }
          });
      }
  }
  </code></pre>
  
  <p>How can I call the value of html <code>final String html = ele.toString();</code> and cast it to <code>WebView.loadData(html, mime, encoding);</code>?</p>