Closed hafs-r closed 8 years ago
I have similar issue. Let me know if you find any solution.
@hafsalrahman I found solution for this problem. First you have to download this library and import it as module. Then Edit in QRCodeReaderView class.
In That you find onSurfaceChanged Method. and
mPreviewWidth = mCameraManager.getPreviewSize().x; mPreviewHeight = mCameraManager.getPreviewSize().y;
mCameraManager.stopPreview();
mCameraManager.getCamera().setDisplayOrientation(90); // Portrait mode
mCameraManager.startPreview();
mCameraManager.getCamera().setPreviewCallback(this);
Just resplace
mCameraManager.stopPreview();
with
mCameraManager.startPreview();
I don't know whether it affect in any other code or not . But it worked for me.
@hafsalrahman are you running this on Android 5.0 or Android 6.0? If that's the case, please assert that you have camera permissions before start the customview
Yes I am running on android 6.0. And i have also added camera permission.
On Mon, Jul 18, 2016 at 8:55 PM, David Lázaro notifications@github.com wrote:
@hafsalrahman https://github.com/hafsalrahman are you running this on Android 5.0 or Android 6.0? If that's the case, please assert that you have camera permissions before start the customview
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dlazaro66/QRCodeReaderView/issues/45#issuecomment-233362460, or mute the thread https://github.com/notifications/unsubscribe-auth/AOkUhBAZ3qfbDWmaZqaTjedoTLuopsCJks5qW5rpgaJpZM4IDnSO .
Regards, Lalit Jadav
Please checkout the sample project and see how we implemented the live camera permissions. This issue is related to that
it is working fine now
@hafsalrahman how did you manage to get it working ?
@lalitjadav007 and @hafsalrahman
While this method: mCameraManager.startPreview(); called twice
i think this is one of the stuff casing app to crash on some major phone
java.lang.RuntimeException: startPreview failed at android.hardware.Camera.startPreview(Native Method) at com.google.zxing.client.android.camera.open.CameraManager.startPreview(CameraManager.java:138)