首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android WebView随机不响应触摸事件

Android WebView随机不响应触摸事件
EN

Stack Overflow用户
提问于 2015-11-30 14:14:32
回答 1查看 1.9K关注 0票数 0

我的Android Web应用程序有问题。

应用程序安装在仅为此目的运行的平板电脑(LGV700 - 4.4.2)上(供电24/7)。

该应用程序是一个带有一些额外功能的web应用程序的包装器,它是从远程url加载的( webview是在代码中动态创建的)。

问题是,应用程序会随机冻结/停止对大多数触摸事件(通常是在长时间正常运行后)的反应,并一直持续到应用程序重新启动。

使用分析器检查应用程序可以发现内存使用率很高,但是GC似乎运行良好,在达到内存限制时清除所有未使用的内存。

我尝试将largeHeap和hardwareAccelerated属性添加到清单中,但似乎没有帮助。

我不确定这是唯一的问题,但有时应用程序会被强制关闭,下面的错误会抛给logcat:

代码语言:javascript
复制
11-30 13:01:54.477  28591-28652/********* W/Adreno-EGLSUB﹕ <DequeueBuffer:736>: dequeue native buffer fail: Unknown error 2147483646, buffer=0x0, handle=0x0
11-30 13:01:54.487  28591-28652/********* W/Adreno-ES20﹕ <core_glFlush:52>: GL_OUT_OF_MEMORY
11-30 13:01:54.487  28591-28652/********* W/Adreno-EGLSUB﹕ <DequeueBuffer:736>: dequeue native buffer fail: Function not implemented, buffer=0x0, handle=0x0
11-30 13:01:54.487  28591-28652/********* E/chromium﹕ [ERROR:gles2_cmd_decoder.cc(2123)] [GroupMarkerNotSet(crbug.com/242999)!:549845A5]GL ERROR :GL_OUT_OF_MEMORY : GLES2DecoderImpl::PrepareTexturesForRender: <- error from previous GL command
11-30 13:01:54.487  28591-28652/********* E/chromium﹕ [ERROR:gles2_cmd_decoder.cc(4422)] Error: 5 for Command kDrawElements
11-30 13:01:54.487  28591-28652/********* W/Adreno-EGLSUB﹕ <DequeueBuffer:736>: dequeue native buffer fail: Function not implemented, buffer=0x0, handle=0x0
11-30 13:01:54.487  28591-28652/********* W/Adreno-EGL﹕ <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
11-30 13:01:54.487  28591-28652/********* W/OpenGLRenderer﹕ swapBuffers encountered EGL_BAD_SURFACE on 0xa542ff80, halting rendering...
11-30 13:01:54.777  28591-28652/********* W/google-breakpad﹕ ### ### ### ### ### ### ### ### ### ### ### ### ###
11-30 13:01:54.777  28591-28652/********* W/google-breakpad﹕ Chrome build fingerprint:
11-30 13:01:54.777  28591-28652/********* W/google-breakpad﹕ 1.0
11-30 13:01:54.777  28591-28652/********* W/google-breakpad﹕ 1
11-30 13:01:54.777  28591-28652/********* W/google-breakpad﹕ 45012863-7d3b-4c30-8ccf-e65394c57d85
11-30 13:01:54.777  28591-28652/********* W/google-breakpad﹕ ### ### ### ### ### ### ### ### ### ### ### ### ###
11-30 13:01:54.777  28591-28652/********* A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x54 in tid 28652 (RenderThread)

它看起来像这样的问题:https://code.google.com/p/chromium/issues/detail?id=437017,但它似乎是固定的。

当应用程序检测到internet连接丢失时,它将使用带有原始url的loadUrl函数重新加载When视图。

还值得一提的是,我使用“ANR-看门狗”库来检测Application响应错误(检查主线程是否响应超过5秒),但是当问题发生时,它是无声的。

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-11-30 14:27:24

在java代码中尝试这样做:

代码语言:javascript
复制
webview.getSettings().setRenderPriority(RenderPriority.HIGH);
webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);

并将其添加到您的manifest.xml中:

代码语言:javascript
复制
android:hardwareAccelerated="true"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34000638

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档