WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginsEnabled(true);
myWebView.loadUrl("file:///android_asset/index.html");
myWebView.loadUrl("javascript:hello()");
It doesnt work in 4.0 emulator or real device. I have proper tag in html like
<script type="text/javascript">..</script>
and i can fire it from firefox's console with no problem (it doesnt call alert command, i know it doesnt work in android)
I am out of solutions, please help me.
Btw this function call seems useless here because it is for testing, i will give a parameter later if this works.
Edit:
<h1 id="title"></h1>
....
<script type="text/javascript">
function hello()
{
console.log("hello");
var title = document.getElementById("title");
title.innerHTML = "hello";
}
</script>