Hi Sir, It works normally when just only one camera opened like below. Camera mcamera = Camera.open(0); or Camera mcamera = Camera.open(1); both the stream video are also ok to display. BUT I try open two cameras to preview at the same time in Android APP. it always crashed and seems like framework issue. Please help me out, Many thanks! Log: java.lang.RuntimeException: Fail to connect to camera service at android.hardware.Camera.<init>(Camera.java:497) at android.hardware.Camera.open(Camera.java:342) at com.goer.dualcamera.MainActivity$2.surfaceCreated(MainActivity.java:76) at android.view.SurfaceView.updateWindow(SurfaceView.java:633) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:197) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2086) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1161) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6198) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5280) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)
|