当前位置:   article > 正文

background引起错误:Error inflating class_service error inflating class com.

service error inflating class com.

具体错误:

  1. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.serenegiant.usbcameratest/com.serenegiant.usbcameratest.MainActivity}:
  2. android.view.InflateException: Binary XML file line #32 in com.serenegiant.usbcameratest:layout/activity_main:
  3. Binary XML file line #32 in com.serenegiant.usbcameratest:layout/activity_main:
  4. Error inflating class com.serenegiant.widget.SimpleUVCCameraTextureView

解决办法:

一般是因为缺少构造函数。吾看了代码,是有这个函数的。于是再看:

  1. Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
  2. 2021-12-01 19:35:02.992 11716-11716/? E/AndroidRuntime: at android.view.TextureView.setBackgroundDrawable(TextureView.java:328)

原来是background这个属性已经不支持了,去掉就正常了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/235475
推荐阅读
相关标签
  

闽ICP备14008679号