开发者

Webpage not available on Honeycomb webview

开发者 https://www.devze.com 2023-02-25 11:54 出处:网络
We have a webview that we are loading from android_assets.This works fine in 2.1, 2.2, and 2.3.However, when we load it in 3.0, we get a \"Webpage not available\" message.

We have a webview that we are loading from android_assets. This works fine in 2.1, 2.2, and 2.3. However, when we load it in 3.0, we get a "Webpage not available" message.

This only happens on pages where we are passing parameters to the webview:

WebView webView = (WebView) findViewById(R.id.my_webview);
webView.getSettings().setJavaScriptEnabled(true);

web开发者_开发知识库View.addJavascriptInterface(new JavaScriptInterface(this), "androidInterface");

webView.setBackgroundColor(0);
//This works
webView.loadUrl("file:///android_asset/my.html");
//This does not work.
webView.loadUrl("file:///android_asset/my.html" + "?param=value");

Any idea how to get this to work on Honeycomb?


Not answer to the original problem, but a workaround. Since I was already using the JavascriptInterface, I set the value that I wanted to read in Javascript on the JavascriptInterface.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号