的WebView抛出接收器未注册:android.widget.ZoomButtonsController [英] WebView throws Receiver not registered: android.widget.ZoomButtonsController
问题描述
我看到这个异常零星地提高了我的应用程序(在野外)。 web视图用于显示一幅JPG格式(使用的Android版本的缩放/滚动功能/设备,而不是重新发明轮子,做所有的反射的东西)。
I see this exception sporadically raising up in my application (in the wild). The WebView is used to display a jpg (using the zoom/scroll-capabilities of the Android version/the device instead reinventing the wheel and do all the reflection stuff).
我不知道为什么这个异常可能最终冒出来。基本上我只能想到一个Android的bug。
I have no idea why this exception eventually could come up. Basically I can only think of an Android bug.
我做的(一切都在GUI线程):
What I do (everything in GUI thread):
- 在第一次显示缩略图为preVIEW
- 设置的getSettings()。setBuiltInZoomControls(假)
- 当普通图片加载,显示那一个,而不是
- 设置的getSettings()。setBuiltInZoomControls(真)
为什么设置开/关ZoomControls:拇指不应缩放,作为web视图重置该上loadData只要定期图象信息,并将显示。将一些不好的用户体验。
Why setting ZoomControls on/off: The thumb should not be zoomable, as the WebView resets this on loadData as soon as the regular picture is available and displayed. Would be some bad user experience.
例装置发生这种情况: HTC Desire的@ htc_wwe / htc_bravo /布拉沃/布拉沃:2.2 / FRF91 / 226611:用户/释放键
Example device this is happening: HTC Desire@htc_wwe/htc_bravo/bravo/bravo:2.2/FRF91/226611:user/release-keys
我有完全一样的设备/软件,而且也从未happend给我...
I have exactly the same device/software and it never happend to me...
任何想法?
问候, 奥利弗
推荐答案
我不喜欢回答我自己,但littleFluffyKitty没有(只在注释)。
I don't like to answer myself, but littleFluffyKitty did not (only in comment).
解决方案是在<一个href="http://stackoverflow.com/questions/5267639/how-to-safely-turn-webview-zooming-on-and-off-as-needed">How以安全地打开web视图缩放和关闭需要
一)创建自己的WebView类
a) create your own WebView class
public class MyWebView extends WebView {
二)加在它的的onDestroy()方法:
b) add in it's onDestroy() method:
getSettings().setBuiltInZoomControls(true);
就是这样。感谢的是,没有更多的这些例外的出现。
That's it. Thanks to that, no more of those Exceptions show up.
这篇关于的WebView抛出接收器未注册:android.widget.ZoomButtonsController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!