BitmapUtils Could not lock surface

WittLiu 发布于 2015/03/13 12:59
阅读 2K+
收藏 0

@wyouflf 你好,想跟你请教个问题:

xutils 的 BitmapUtils , 列表快速上下滑动,会卡死 报错:

03-13 11:02:10.206: E/Surface(18201): dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -2147483646
03-13 11:02:10.206: E/Surface(18201): dequeueBuffer failed (Unknown error 2147483646)
03-13 11:02:10.206: E/ViewRootImpl(18201): Could not lock surface
03-13 11:02:10.206: E/ViewRootImpl(18201): java.lang.IllegalArgumentException
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.Surface.nativeLockCanvas(Native Method)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.Surface.lockCanvas(Surface.java:249)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2723)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2697)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2535)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2151)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6350)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.Choreographer.doCallbacks(Choreographer.java:591)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.Choreographer.doFrame(Choreographer.java:561)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.os.Handler.handleCallback(Handler.java:730)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.os.Handler.dispatchMessage(Handler.java:92)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.os.Looper.loop(Looper.java:137)
03-13 11:02:10.206: E/ViewRootImpl(18201): at android.app.ActivityThread.main(ActivityThread.java:5419)
03-13 11:02:10.206: E/ViewRootImpl(18201): at java.lang.reflect.Method.invokeNative(Native Method)
03-13 11:02:10.206: E/ViewRootImpl(18201): at java.lang.reflect.Method.invoke(Method.java:525)
03-13 11:02:10.206: E/ViewRootImpl(18201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
03-13 11:02:10.206: E/ViewRootImpl(18201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
03-13 11:02:10.206: E/ViewRootImpl(18201): at dalvik.system.NativeStart.main(Native Method)


加载中
0
y
yejunhui
楼主你解决了吗?我也遇到这个问题?求解啊
杨翔
E/DefaultDownloader.downloadToStream(L:86)(16359): java.io.FileNotFoundException: /storage/emulated/0/see/IMG/ee162c6943507fd6.jpg: open failed: EMFILE (Too many open files)
杨翔
有时候报如下错误:E/DefaultDownloader.downloadToStream(L:86)(16359): Caused by: libcore.io.ErrnoException: open failed: EMFILE (Too many open files)
杨翔
listView.setOnScrollListener(new PauseOnScrollListener(bitmapUtils, false, true)); 上面那样设置还是没用
杨翔
同求
0
鹭岛猥琐男
鹭岛猥琐男
现在也遇到了这个问题,该怎么解决了,在华为荣耀6出现了这个问题
J
JasonTT
LruMemoryCache<MemoryCacheKey, Bitmap> mMemoryCache这种存储方式有问题吗?怎么解决的能给出部分源码吗?朋友
r
rounding
@will_L 能麻烦你贴上代码么?
WittLiu
WittLiu
我的解决方案是 在图片第一次加载的时候 使用display(),CallBack里图片加载成功后,使用软引用存储,后面的刷新就是直接从软引用里取, 问题解决,同样也避免了图片刷新时的闪烁
0
x
xww2013
楼主在扯淡吧~~bitmapUtils 不就是用的缓存么?
0
弟大勿勃
这个是硬件加速的问题,去掉OK
0
king1970337657
king1970337657
请问最后是怎么解决的啊?现在一直有这个问题,硬件加速开启或关闭都一样
WittLiu
WittLiu
现在用了 XUtils3 x.image().bind((ImageView) container, uri, displayConfig);
返回顶部
顶部