Black Screen, no Camera Preview
See original GitHub issueDescription of the problem:
When I am using the below code to access the barcode scanner camera then as in the below image, a black screen covers what should have been the camera instead. I have made sure that the camera permission is granted.
` <com.journeyapps.barcodescanner.DecoratedBarcodeView android:id=“@+id/scanner” android:layout_width=“match_parent” android:layout_height=“200dp” app:zxing_preview_scaling_strategy=“centerCrop” app:zxing_use_texture_view=“false” />
<com.journeyapps.barcodescanner.ViewfinderView
android:id="@+id/zxing_viewfinder_view"
android:layout_width="match_parent"
android:layout_height="200dp" />
`
My need is to reduce the size of the scanning camera to a given size ex -> as in the figure, so if there is a way around that, then please mention that.
Which library version are you using? 3.5.0.
Logs:
05-23 00:37:34.082 3062-3103/com.raywenderlich.alltherages E/CameraInstance: Failed to open camera java.lang.RuntimeException: Fail to connect to camera service at android.hardware.Camera.<init>(Camera.java:568) at android.hardware.Camera.open(Camera.java:405) at com.google.zxing.client.android.camera.open.OpenCameraInterface.open(OpenCameraInterface.java:83) at com.journeyapps.barcodescanner.camera.CameraManager.open(CameraManager.java:138) at com.journeyapps.barcodescanner.camera.CameraInstance$3.run(CameraInstance.java:190) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61)
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top GitHub Comments
@Override protected void onResume() { super.onResume(); barcodeView.resume(); }
@Override protected void onPause() { super.onPause(); barcodeView.pause(); }
Please add this, you can open a camera view.
!!! android:hardwareAccelerated=“true” !!!