dlazaro66 / QRCodeReaderView

Modification of ZXING Barcode Scanner project for easy Android QR-Code detection and AR purposes
1.9k stars 491 forks source link

Stoping camera does not work #134

Open busylee999 opened 7 years ago

busylee999 commented 7 years ago

Force stoping camera does not working for me. If we stop camera and does not pause activity, CameraManager.onSurfaceChanged callback still fires and CameraManager startPreview method is being called

dlazaro66 commented 6 years ago

Can you provide more info about what do you want to achieve?

busylee999 commented 6 years ago

In fact as a result this behavior I suppose, leads to crash. The case you can face crash:

  1. Open you activity with View installed
  2. Start preview
  3. Open camera app
  4. Reopen you activity

Result will be a crash, I think, because lib does not release camera. I fixed this bug in my local copy of library.

MajedDH commented 6 years ago

Actually I've noticed this problem too (the original one of the post). once the activity start in OnResume i call stopCamera() but after that when the CameraManager.onSurfaceChanged is called the QRCodeReaderView recalls your internal startPreview() method, which turns on the camera.

amandahla commented 6 years ago

How did you solved that? :(