title: webView.loadData from html code doesn't work
body: <p>i have a full screen web view, where:<br>
  1) i send an xml file to a php script<br>
  2) the php script build the page using javascript and echo back the whole code<br>
  3) the webview load ( should load ) the result.</p>
  
  <p>Reading the result from the script, i can see the entire html code, but the web view doesn't load it. here is the logcat with the result page:  <a href="http://pastebin.com/yjKK10SY" rel="nofollow">http://pastebin.com/yjKK10SY</a></p>
  
  <p>and this is how i handle the request / response client side:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.webview);
  
      final String url = "http://www.mysite.meh/google_api/test.php";
      String selected = getIntent().getStringExtra("com.example.simplerun.filename");
      final File file = new File("/storage/sdcard0/SimpleRun/"+selected + ".xml");
      Log.i("FILE SIZE: ", "" + file.length());
  
      final WebView mWebView = (WebView) findViewById(R.id.webview);
      mWebView.getSettings().setJavaScriptEnabled(true);
      mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
      mWebView.getSettings().setSaveFormData(true);
      mWebView.setWebViewClient(new MyWebViewClient());
  
      Thread thread = new Thread()
      {
          public void run()
          {
  
      HttpClient httpclient = new DefaultHttpClient();
      HttpPost httppost = new HttpPost(url);
  
      try {
        MultipartEntity entity = new MultipartEntity();
  
        entity.addPart("userfile", new FileBody(file));
        httppost.setEntity(entity);
        HttpResponse response = httpclient.execute(httppost);
        String res = EntityUtils.toString(response.getEntity());
          Log.i("RESPONSE: ", res);
          //String uri = Uri.encode(res);
          mWebView.loadData(res, "text/html; charset=UTF-8", null);
      } catch (ClientProtocolException e) {
      } catch (IOException e) {
      }
          }
      };
      thread.start();
  
      try
      {
          thread.join();
  
      }
      catch(InterruptedException e)
      {
          e.printStackTrace();
      }
  
  
  
      /*
      Thread thread = new Thread()
      {
          public void run()
          {
              HttpClient client = new DefaultHttpClient();
              HttpPost post = new HttpPost(url);
              client.getParams().setParameter("userfile", file);
  
              try
              {
                  HttpResponse response = client.execute(post);
                  String res = EntityUtils.toString(response.getEntity());
                  Log.i("RESPONSE: ", res);
                  mWebView.loadData(res, "text/html", HTTP.UTF_8);
  
              }
              catch(ClientProtocolException e)
              {
                  e.printStackTrace();
              }
              catch(IOException e)
              {
                  e.printStackTrace();
              }
          }
      };
      thread.start();
  
      try
      {
          thread.join();
      }
      catch(InterruptedException e)
      {
          e.printStackTrace();
      }
  
      */
  
      /*
      WebView mWebView = (WebView) findViewById(R.id.webview);
      mWebView.getSettings().setJavaScriptEnabled(true);
      mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
      mWebView.getSettings().setSaveFormData(true);
      mWebView.setWebViewClient(new MyWebViewClient());
      */
  }
  
  private class MyWebViewClient extends WebViewClient {
      @Override
      // show the web page in webview but not in web browser
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          view.loadUrl(url);
          return true;
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>when the activity start, the screen remain blank, where i'm doing wrong?</p>