java.lang.RuntimeException: Fail to connect to camera service

玩自定义照相机的时候出现了:java.lang.RuntimeException: Fail to connect to camera service

讲过百度和Google后知道是权限少加了。(试验过的,放心用)

需要加的权限如下:

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

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

    <uses-permission android:name="android.permission.CAMERA" />

    <uses-permission android:name="android.permission.FLASHLIGHT" />

 如果添加权限后还是不行,那么尝试重启一下手机!

你可能感兴趣的:(java.lang.RuntimeException: Fail to connect to camera service)