Is it possible to pass a value to the URL mentioned in webView.loadUrl? something like this??
webView.loadUrl("file:///android_asset/www/index.html#value="+value);
or is there any way to pass a Java String value to the Javascript function in loadURL?
I found the solution.. posting it here for the sake of others :)
I added the following snippet of code in my Activity class which solved the problem,
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url)
{
webView.loadUrl("javascript:callMe(\""+data_val+"\")");
}
});
Thanks all :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With