Pass String to webview and display
<p>I am trying to pass versionName string to webview and display the string on the page in my html. Here is what I have tried.</p>

<pre><code>try {
    myWebView.getSettings().setJavaScriptEnabled(true);
    String versionName = getPackageManager()
                            .getPackageInfo("com.chad.flashupdate", 0)
                            .versionName;
    myWebView.loadUrl("javascript:init('" + versionName + "')");
} catch (NameNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
</code></pre>

<p>Then I tried to load and display the string using this.</p>

<pre><code> $( document ).ready(function() { $("#MyEdit").html(versionName); });
</code></pre>

<p>In my html I put this.</p>

<pre><code>&lt;div id="MyEdit"&gt;&lt;B&gt;
 versionName will be displayed here!
&lt;/B&gt;&lt;/div&gt;
</code></pre>

<p>When I try that nothing happens, meaning the div text never changes. So maybe the webview is not loading the string. Thanks for any help!</p>