background引起错误:Error inflating class

简介: background引起错误:Error inflating class

具体错误:


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

解决办法:


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


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

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

目录
相关文章
|
Java Maven Spring
|
3月前
|
测试技术 C++
【C++】解决googleTest报错error: SEH exception with code 0xc0000005 thrown in the test body.
【C++】解决googleTest报错error: SEH exception with code 0xc0000005 thrown in the test body.
|
6月前
Should pass resolved color instead of resource id here: getResources().getColor(R.color.brown)
Should pass resolved color instead of resource id here: getResources().getColor(R.color.brown)
50 6
|
6月前
|
XML Android开发 数据格式
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class
56 0
|
自然语言处理 Python
A reportable application error has occurred. Conda has prepared the above report......
A reportable application error has occurred. Conda has prepared the above report......
240 0
A reportable application error has occurred. Conda has prepared the above report......
|
XML 数据格式
因为CircleImageView导致Binary XML file line #96: Error inflating class <unknown>
因为CircleImageView导致Binary XML file line #96: Error inflating class <unknown>
175 0
background引起错误:Error inflating class
background引起错误:Error inflating class
239 0
|
Java 应用服务中间件 Android开发