BarcodeScanner.Mobile
BarcodeScanner.Mobile copied to clipboard
Why is the camera blocked for barcodescanner after taking photo
Hi all,
I'm a little bit confused cause I would like to scan barcodes with this library and after that, taking one or more photos with the camera.
You can use this repo and add a new button in the MainPage and use the following eventhandler in the code behind.
private async void Button_Clicked_8(object sender, EventArgs e)
{
var status = await Permissions.RequestAsync<Permissions.Camera>();
if(status == PermissionStatus.Granted)
{
var photo = await MediaPicker.CapturePhotoAsync(new MediaPickerOptions { Title = "Give me a smile" });
if (photo != null)
{
// ...
}
}
}
After making a few photos, try to use the barcodescanner again. It will fail! The camera view is black. I don't know why! Sometimes it happens after 2 times, sometimes after first time.
On my old Android 10 it works like expected. On my Android 11, it fails like described.
Any ideas?