Import android.hardware.camera2 cannot be allowed

When using import android.hardware.camera2. I receive import may not be allowed. How to fix this problem. I tried everything that was mentioned in another solution, but I cannot fix it. Please, help. Thanks in advance.

+4
source share
1 answer

I want to use the new android.hardware.Camera2 api

There is no Java class android.hardware.Camera2 in Android. There is a Java package called android.hardware.Camera2 . You can use classes from this Java package, for example android.hardware.camera2.CameraManager .

"Import equipment and Android. Camera2 impossible to solve"

This is because in Android called android.hardware.Camera2 there is no Java class. There is a Java package called android.hardware.Camera2 . You can use classes from this Java package, for example android.hardware.camera2.CameraManager , using import statements such as:

 import android.hardware.camera2.CameraManager; 

or even:

 import android.hardware.camera2.*; 
+9
source

All Articles