Android 使用 TextureView 遇到的问题

2014-05-13 11:24:30 +08:00
 over140
捕获到的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
23353 次点击
所在节点    Android
2 条回复
xiaojiaqiao
2016-01-07 10:09:55 +08:00
同遇到,请问解决了没有
xitiecheng
2018-11-13 17:16:07 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/112307

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX