捕获到的log如下:
java.lang.RuntimeException: Error during detachFromGLContext (see logcat for details)
at android.graphics.SurfaceTexture.detachFromGLContext(SurfaceTexture.java:217)
at android.view.TextureView.destroySurface(TextureView.java:226)
at android.view.TextureView.destroyHardwareResources(TextureView.java:336)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1670)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
at android.view.HardwareRenderer$Gl20Renderer.access$600(HardwareRenderer.java:1425)
at android.view.HardwareRenderer$Gl20Renderer$2.run(HardwareRenderer.java:1662)
at android.view.HardwareRenderer$Gl20Renderer.safelyRun(HardwareRenderer.java:1605)
at android.view.HardwareRenderer$Gl20Renderer.destroyHardwareResources(HardwareRenderer.java:1652)
at android.view.ViewRootImpl.terminateHardwareResources(ViewRootImpl.java:741)
at android.view.WindowManagerGlobal.startTrimMemory(WindowManagerGlobal.java:403)
at android.app.ActivityThread.handleTrimMemory(ActivityThread.java:4310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5331)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
~~~~
补充说明:
1、有查到说TextureView所在的Activity需要设置android:hardwareAccelerated="true",现在全都设置了还是会报错。
2、从统计数据来看只有三星的设备不会报这个错误,HUAWEI、OPPO、vivo、Coolpad、红米、索尼S39h这些设备会出错
3、这个错误并不是毕现。
又遇到同样问题的同学还请分享一下经验^ ^
~~~~
额外发个招小伙伴的帖子:
http://www.neitui.me/j/69648