连接照相机服务失败
Fail to connect to camera service
重启手机,就行了。
Restart your cell phone, and that's
it.
这是因为照相机服务还在,没有被正常释放。检查并修缮代码。
This is because the camera
service is still there, and is not normally
released.Check and repair code.
===========详细错误日志:
detail error
log:
08-04
01:45:03.373: E/libEGL(1380): cache file failed CRC
check
缓存文件失败的CRC校验
08-04 01:45:06.217: E/AndroidRuntime(1380): FATAL
EXCEPTION: main
08-04 01:45:06.217: E/AndroidRuntime(1380): Process:
com.example.frontandrearcameras, PID: 1380
08-04 01:45:06.217: E/AndroidRuntime(1380):
java.lang.IllegalStateException: Could not execute method of the
activity
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.view.View$1.onClick(View.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.view.View.performClick(View.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.view.View$PerformClick.run(View.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.os.Handler.handleCallback(Handler.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.os.Handler.dispatchMessage(Handler.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.os.Looper.loop(Looper.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.app.ActivityThread.main(ActivityThread.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
08-04 01:45:06.217: E/AndroidRuntime(1380): at
08-04 01:45:06.217: E/AndroidRuntime(1380): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.
08-04 01:45:06.217: E/AndroidRuntime(1380): Caused by:
java.lang.reflect.InvocationTargetException
08-04 01:45:06.217: E/AndroidRuntime(1380): at
08-04 01:45:06.217: E/AndroidRuntime(1380): at
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.view.View$1.onClick(View.
08-04 01:45:06.217: E/AndroidRuntime(1380): ... 10
more
08-04 01:45:06.217: E/AndroidRuntime(1380): Caused by:
java.lang.RuntimeException: Fail to connect to camera
service
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.hardware.Camera.(Camera.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
android.hardware.Camera.open(Camera.
08-04 01:45:06.217: E/AndroidRuntime(1380): at
com.example.frontandrearcameras.MainActivity.openRearCamera(MainActivity.
08-04 01:45:06.217: E/AndroidRuntime(1380): ... 13
more