Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import of android.hardware.camera2 cannot be resolved

On using import android.hardware.camera2. I am getting import cannot be resolved. How to clear this problem. I tried everything mentioned in other solution but I am not able to fix this up. Please do help. Thanks in advance.

like image 253
Nandan A Avatar asked Aug 23 '15 18:08

Nandan A


1 Answers

I want to use new api android.hardware.Camera2

There is no Java class in Android named android.hardware.Camera2. There is a Java package named android.hardware.camera2. You are welcome to use classes out of that Java package, such as android.hardware.camera2.CameraManager.

"The import android. hardware. Camera2 cannot be resolved"

That is because there is no Java class in Android named android.hardware.Camera2. There is a Java package named android.hardware.camera2. You are welcome to use classes out of that Java package, such as android.hardware.camera2.CameraManager, via import statements like:

import android.hardware.camera2.CameraManager;

or even:

import android.hardware.camera2.*;
like image 142
CommonsWare Avatar answered Sep 18 '22 00:09

CommonsWare