首页 / 浏览问题 / 移动GIS / 问题详情
没有导致程序崩溃的b报错
58EXP 2023年03月23日

每次都有这个报错,但是程序一直没问题,不知道什么情况。。。。 

2023-03-23 10:26:08.216 24868-24868/com.example.jstifiled E/SurfaceHolder: Exception locking surface
    java.lang.IllegalArgumentException: Surface was already locked
        at android.view.Surface.lockCanvas(Surface.java:405)
        at android.view.SurfaceView$2.internalLockCanvas(SurfaceView.java:1681)
        at android.view.SurfaceView$2.lockCanvas(SurfaceView.java:1641)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:365)
        at com.supermap.mapping.MapControl1.refreshCallback(MapControl1.java:1072)
        at com.supermap.mapping.MapControlNative.jni_SetSize(Native Method)
        at com.supermap.mapping.MapControl1.a(MapControl1.java:1218)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:375)
        at com.supermap.mapping.MapControl1$3.surfaceCreated(MapControl1.java:338)
        at android.view.SurfaceView.updateSurface(SurfaceView.java:1275)
        at android.view.SurfaceView.lambda$new$0$SurfaceView(SurfaceView.java:179)
        at android.view.-$$Lambda$SurfaceView$w68OV7dB_zKVNsA-r0IrAUtyWas.onPreDraw(Unknown Source:2)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3260)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2091)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8582)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1076)
        at android.view.Choreographer.doCallbacks(Choreographer.java:897)
        at android.view.Choreographer.doFrame(Choreographer.java:826)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1061)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:236)
        at android.app.ActivityThread.main(ActivityThread.java:8164)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

问题关闭原因: 已解决

1个回答

您好,

1.报错的该方法参数为inOutDirty–一个矩形,表示调用者想要重新绘制的脏区域。例如,如果曲面的大小已调整,或者曲面以前的内容不可用,则此函数可以选择展开脏矩形。从该函数返回时,调用方必须重新绘制由inOutDirty矩形的内容表示的整个脏区域。在应该重新绘制整个曲面的情况下,调用者也可以传递null。

2.理想情况下,nativeLockCanvas()会引发这种情况并防止双重锁定,但如果更新了mNativeObject,就不会发生这种情况。原有mLockedObject不可更改,因为它可能仍在使用中,所以该报错是由于android只是拒绝重新锁定Surface抛出的异常提示,因为后续调用了nativeLockCanvas()方法,所以surface得以正常显示
3,745EXP 2023年03月23日
...