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.
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();
}
Then I tried to load and display the string using this.
$( document ).ready(function() { $("#MyEdit").html(versionName); });
In my html I put this.
<div id="MyEdit"><B>
versionName will be displayed here!
</B></div>
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!