title: How to get editable web view content to string in Android.?
body: <p>I want to implement a Rich text editor by using a webview in android. Content can be loaded by using a HTML file (which resides in assets) without any problem. But if user has edited the content of the webview (with all the formatting), I need to get the modified content as a HTML string and save it in the database. How can I do this?
  I tried in many ways but it seems that we need to pass a URL to get the content of the webview. But after editing the webview content, how can we get the edited URL? or current updated webview content to HTML formatted string?
  Using below code I made editable web view.</p>
  
  <pre><code>    String msgBody = "&lt;html&gt;\n"+
      "&lt;body&gt;\n"+
      "&lt;div id=\"content\" contenteditable=\"true\" style=\"font-family:Helvetica;font-size:14px\"&gt;" + a +" &lt;/div&gt;\n"+
      "&lt;/body&gt;"+
      "&lt;/html&gt;";
  
     // wbview = (WebView)this.findViewById(R.id.wbview);
      wbView.getSettings().setJavaScriptEnabled(true);
      wbView.loadDataWithBaseURL("", msgBody, "text/html", "UTF-8", "");
      wbView.setHorizontalScrollBarEnabled(true);
      wbView.setVerticalScrollBarEnabled(true);
  </code></pre>
  
  <p>In iOS we can get it easily by using below code line.</p>
  
  <pre><code> NSString* html=[_tbEmail.webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].innerHTML"];
  </code></pre>