tags:

views:

729

answers:

1

Hi,

I'm using the Android APIDemo sample code.

When I run the CameraPreview example, at first it was giving me an error.
(http://stackoverflow.com/questions/2556389/android-camera-functionality-howto)

I traced that one down and the sample was working for a while.
Now, it no longer works. It says ERROR/AndroidRuntime(2949): java.lang.RuntimeException: Fail to connect to camera service

What can be causing that? It happens when camera.open() is called.

Thanks,
Tee

A: 

Make sure your <uses-permission> elements are in the proper positions in your AndroidManifest.xml file.

CommonsWare
I still get this error randomly. One of my activities connect to camera, take some picture on emulator, passes on the data to next activity. When I restart the activity with some delay, the application crashes with the same error. But this works next time when i launch the complete application as fresh
Nayn