[英]Can't import android.hardware.camera2.params.StreamConfiguration
In Android API 21 they added android.hardware.camera2.params.StreamConfiguration
but for some reason Android Studio can't find it. 他们在Android API 21中添加了android.hardware.camera2.params.StreamConfiguration
但由于某些原因,Android Studio无法找到它。
Also this class ( android.hardware.camera2.params.StreamConfigurationMap
) has a public constructor and yet it says I can't create an instance of it outside its package. 另外,此类( android.hardware.camera2.params.StreamConfigurationMap
)具有公共构造函数,但它说我无法在其包之外创建其实例。 Why?! 为什么?!
Tried this: 试过这个:
StreamConfigurationMap map = new StreamConfigurationMap(); //Says can only be instantiated in its package
StreamConfiguration map = new StreamConfiguration(); //can't find StreamConfiguration
StreamConfigurationMap
does not have a public constructor. StreamConfigurationMap
没有公共的构造函数。
The android.hardware.camera2.params
package does not expose the StreamConfiguration
class. android.hardware.camera2.params
包未公开StreamConfiguration
类。 StreamConfigurationMap
does allow you to use a StreamConfiguration
to obtain a configuration- the configurations available are documented here . StreamConfigurationMap
确实允许您使用StreamConfiguration
来获取配置- 此处记录了可用的配置。
The StreamConfiguration
class and the StreamConfigurationMap
constructor are hidden from the public Android API using the @hide
annotation, so you cannot use them. 使用@hide
注释从公共Android API中隐藏了StreamConfiguration
类和StreamConfigurationMap
构造函数,因此您不能使用它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.