表面 - dequeueBuffer失败(未知错误2147483646) [英] Surface - dequeueBuffer failed (Unknown error 2147483646)

查看:2777
本文介绍了表面 - dequeueBuffer失败(未知错误2147483646)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在挣扎了3天一个Android应用程序,使用一个的WebView 来加载自己的网站,其中包含数千张图片。 该应用程序开始很好,但滚动槽几百图像的WebView后冻结(不强行关闭)的 logcat的(检查在引擎收录)节目

I've been struggling for 3 days with an android app that uses a webview to load my website that contains thousands of images. The application start well but after scrolling trough a couple hundred images the webview freezes (it doesn't force-close) the logcat (check it on pastebin) shows

E/Surface dequeueBuffer failed (Unknown error 2147483646)

我已经试过什么:

What I've tried:

  1. 在限制对每一项活动图像的数量,当用户观看100 图像,启动另一个活动。
  2. 清除web视图缓存onCreation,在onPause,的onStop等... clearCache(真);
  3. 设置web视图缓存为false setAppCacheEnabled(假);
  4. 杀死活性的开幕活动B和反之亦然
  5. webView.setLayerType()为NONE,软件和硬件
  6. 声明机器人:largeHeap =真正的机器人:hardwareAccelerated =真正的在清单
  7. 把web视图一个占位符内将其删除之前,结束();

  1. Limit the number of images on every activity, when a user views 100 images, start another activity.
  2. Clear the webview cache onCreation, onPause, onStop, etc... clearCache(true);
  3. Set the webview cache to false setAppCacheEnabled(false);
  4. Kill activity A after opening activity B and vice versa
  5. Set the webView.setLayerType() to NONE, SOFTWARE and HARDWARE
  6. Declare "android:largeHeap="true" and android:hardwareAccelerated="true" on the manifest.
  7. Put the webview inside a placeholder a remove it before finish();

webViewPlaceholder.removeView(myWebView);
myWebView.removeAllViews();
myWebView.destroy();

webViewPlaceholder.removeView(myWebView);
myWebView.removeAllViews();
myWebView.destroy();

看来,Android的保持的WebView 在内存中清除缓存没有任何影响。
当我关闭应用程序并重新打开它立即出现错误,如此看来,即使不关闭应用程序释放其占用的内存。
老实说,我不明白的方式来解决这个问题,我读过的答案相当数量的在SO上的WebView问题,但我还是没能解决问题。
我想AP preciate一个在这里!

It seems that android keeps the webview in memory and cleaning the cache doesn't have any effect.
When I close the app and reopen it the error appears immediately, so it seems that not even closing the app releases the memory it uses.
I honestly don't see a way to fix this, I've read a fair amount of answers at SO to problems on webview but I still couldn't fix the problem.
I would appreciate a light here!

推荐答案

有关奇巧4.4.3或更高版本将硬件加速设置为false:

for KitKat 4.4.3 or later set the hardware acceleration to false:

webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

这篇关于表面 - dequeueBuffer失败(未知错误2147483646)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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