4.4冻结与nativeOnDraw Android的网页视图失败;空地背景颜色 [英] Android Webview on 4.4 freezes with nativeOnDraw failed; clearing to background color

查看:2258
本文介绍了4.4冻结与nativeOnDraw Android的网页视图失败;空地背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问了许多<一个href=\"http://stackoverflow.com/questions/20675554/webview-rendering-issue-in-android-kitkat\">times并有arounds.But他们没有几个工作为我工作

我有一个使用的WebView一个应用程序。在打开许多应用程序,然后醒来这个应用程序有时会使web视图的空白。应用程序的其他组件协同工作,但WebView中被卡住。

我禁用了硬件加速的Andr​​oidManifest.xml 并没有奏效

 &lt;应用
    机器人:名字=com.nandish.app.MyApplication
    机器人:largeHeap =真
    机器人:hardwareAccelerated =假&GT;

我试图在添加以下行至网页视图的构造函数

  setLayerType(View.LAYER_TYPE_SOFTWARE,NULL);

即使这是行不通的。我能够始终如一地再现空白屏幕。结冰时,原木错误消息是

  09-11 23:29:31.237:W / AwContents(2976):nativeOnDraw失败;结算到背景颜色。


解决方案

我的code的问题是,用在其他地方得到了编辑,因为它是一个静态变量web视图对象。我的坏,那是彻底的灾难使用这个对象作为静态的。有一次,我转换为实例变量,它的工作。

I know this question has been asked many times and there are few work arounds.But none of them work for me

I have a app that uses webview . On opening many apps and then waking up this app sometimes makes the webview blank. Other components of the app works but the webview is stuck.

I disabled the hardware acceleration in Androidmanifest.xml and it did not work

<application
    android:name="com.nandish.app.MyApplication"
    android:largeHeap="true"
    android:hardwareAccelerated="false">

I tried to add the following line in to the constructor of Webview

    setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Even this does not work. I am able to reproduce the blank screen consistently. When it freezes, the error message on logs are

09-11 23:29:31.237: W/AwContents(2976): nativeOnDraw failed; clearing to background color.

解决方案

The problem with my code was the webView object that was used was getting edited in other place since it was a static variable. My Bad, that was complete disaster to use this object as static. Once I converted to instance variable, it worked.

这篇关于4.4冻结与nativeOnDraw Android的网页视图失败;空地背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆