android - DequeueBuffer - 出列本机缓冲区失败

时间:2014-11-03 08:01:30

标签: android debugging

我有一个应用程序,我使用列表视图(我从数据库中读取内容)一切正常,直到我滚动几个“页面”然后它丢弃了这个错误:

11-03 08:44:36.273: W/Adreno-EGLSUB(29015): <DequeueBuffer:606>: dequeue native buffer fail: Unknown error 2147483646, buffer=0x0, handle=0x0
11-03 08:44:36.273: W/Adreno-EGL(29015): <qeglDrvAPI_eglSwapBuffers:3692>: EGL_BAD_SURFACE
11-03 08:44:36.273: W/HardwareRenderer(29015): EGL error: EGL_BAD_SURFACE
11-03 08:44:36.273: W/HardwareRenderer(29015): Mountain View, we've had a problem here. Switching back to software rendering.
11-03 08:44:36.493: E/Surface(29015): dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -2147483646
11-03 08:44:36.493: E/Surface(29015): dequeueBuffer failed (Unknown error 2147483646)
11-03 08:44:36.493: E/ViewRootImpl(29015): Could not lock surface
11-03 08:44:36.493: E/ViewRootImpl(29015): java.lang.IllegalArgumentException
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.Surface.nativeLockCanvas(Native Method)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.Surface.lockCanvas(Surface.java:253)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2808)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.draw(ViewRootImpl.java:2782)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2620)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2188)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6585)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.Choreographer.doCallbacks(Choreographer.java:603)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.Choreographer.doFrame(Choreographer.java:573)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.os.Handler.handleCallback(Handler.java:733)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.os.Handler.dispatchMessage(Handler.java:95)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.os.Looper.loop(Looper.java:136)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at android.app.ActivityThread.main(ActivityThread.java:5586)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at java.lang.reflect.Method.invokeNative(Native Method)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at java.lang.reflect.Method.invoke(Method.java:515)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
11-03 08:44:36.493: E/ViewRootImpl(29015):  at dalvik.system.NativeStart.main(Native Method)
11-03 08:44:36.503: E/Surface(29015): dequeueBuffer failed (Invalid argument)
11-03 08:44:36.503: E/ViewRootImpl(29015): Could not lock surface
11-03 08:44:36.503: E/ViewRootImpl(29015): java.lang.IllegalArgumentException
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.Surface.nativeLockCanvas(Native Method)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.Surface.lockCanvas(Surface.java:253)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2808)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at  android.view.ViewRootImpl.draw(ViewRootImpl.java:2782)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2620)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2188)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6585)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.Choreographer.doCallbacks(Choreographer.java:603)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.Choreographer.doFrame(Choreographer.java:573)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.os.Handler.handleCallback(Handler.java:733)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.os.Handler.dispatchMessage(Handler.java:95)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.os.Looper.loop(Looper.java:136)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at android.app.ActivityThread.main(ActivityThread.java:5586)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at java.lang.reflect.Method.invokeNative(Native Method)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at java.lang.reflect.Method.invoke(Method.java:515)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
11-03 08:44:36.503: E/ViewRootImpl(29015):  at dalvik.system.NativeStart.main(Native Method)

(我正在三星Galaxy S5上测试应用程序。) 我是初学Android开发人员,我从来没有见过像这样的错误。谁能告诉我应该继续搜索哪种方式?我迷路了:(谢谢

listView:

listView = (ListView) findViewById(R.id.listview);
listView.setAdapter(adapter);

适配器:

@Override
public Object getItem(int position) {
    return Model.getInstance().getDatabase().getRow(position);
}

1 个答案:

答案 0 :(得分:0)

永远不要在getItem方法中进行任何数据库调用。预加载所有数据或使用CursorAdapter。

我建议你使用CursorAdapter来代替这类代码:Cursor adapter and sqlite example