[Android]Webview中JS接口调用Java-版本问题

问题:

The javascript to java bridge on 2.3 Gingerbread is causing crashes.  This is 100% reproducible using the WebViewDemo application from here: http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Samples/WebViewDemo.
Note: The project file for that app is a little messed up, however, if you recreate the project, keeping the code the same, you can reproduce the error.  The sample is old, but the code should still run as none of these interfaces have been deprecated.

It is also easily reproducible by creating a simple application that creates a webview, enables javascript, adds a JS interface, then loads a script into the webview. The code for this even simpler app is attached as well as WebViewTest and a secondary Test class as the "bridge".

The demos work as expected when using 2.2

This is a serious issue as it will cause crashes for any app using the webview to do any serious work.  Thanks in advance for taking a look at this.

Attached is the output from logcat as well as the output from adb bugreport.
log.txt
8.3 KB   View   Download
bug.txt
1.1 MB   View   Download
WebViewTest.java
764 bytes   View   Download
Test.java
149 bytes   View   Download
 
 
解决方案:
安卓2.3中会有问题,换个target版本启动即可解决。
 
参考:

转载于:https://www.cnblogs.com/webapplee/p/3771909.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值