Camera.open() is not working android

You most likely imported the wrong camera class at the top of your source file, which is android.graphics.Camera.

You need android.hardware.Camera instead.

Thanks


I think you have not added the camera permission. See below - you need to add this in your manifest;

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

Tags:

Android

Camera