error camera is not aviable

Anyone know how to using it for mediarecorder ? im using

recorder.setPreviewDisplay(holder.getSurface) where holder - it's camera ( i see chest rectangle on my screen of phone) When i runn my app - in logcat i see error (camera is not aviable) im try to using function setCamera - but it's not help me. Anyone know how to right use it ?

or maybe i can record video(only video, without audio) some other way?

ok SOLVED

this code for example

mediaRecorder = new MediaRecorder();
        camera.unlock();
        mediaRecorder.setCamera(camera);

Have you forgot to set the permissions on your android manifest?

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

Now I read you have already answered it.

Don't forget to write is as an answer.

The solution would be:

mediaRecorder = new MediaRecorder();
camera.unlock();
mediaRecorder.setCamera(camera);
链接地址: http://www.djcxy.com/p/31138.html

上一篇: Android MediaRecorder IllegalStateException

下一篇: 错误相机不是aviable