wizurd
wizurd

Reputation: 3739

How to fix "CameraInfo cannot be resolved to a field" error?

The following line is causing a " Camera.CameraInfo cannot be resolved to a type" error.

Camera.CameraInfo info = new Camera.CameraInfo();

I have import android.graphics.Camera; at the top of the file. Also, I have

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15" />

in my Manifest file. I've tried to do a Clean, then Build. I've tried closing the project, then re-opening it to no avail. What's causing this?

Upvotes: 0

Views: 1053

Answers (2)

wizurd
wizurd

Reputation: 3739

I solved this by changing the above to android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1006674

There are two classes in Android named Camera. You want android.hardware.Camera, not android.graphics.Camera.

Upvotes: 0

Related Questions