是否有可能通过一个价值在webView.loadUrl提到的网址是什么?这样的事?
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);
或者是有什么办法一个Java String值传递给在使用loadURL Javascript函数?
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 :)
我添加了code下面的代码片段中,解决了这个问题,我的活动课,
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 :)