Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 701 forks source link

Android Camera page will cover up DisplayAlert in Xamarin!? #907

Open huangjinshe opened 4 years ago

huangjinshe commented 4 years ago

When I use Xamarin. I can use MobileBarcodeScanner.ScanContinuously, then I can scan, also display the scan result immediately use App.Current.MainPage.DisplayAlert without terminate the current scan page,

var options = new ZXing.Mobile.MobileBarcodeScanningOptions();
options.PossibleFormats = new List<ZXing.BarcodeFormat>() { ZXing.BarcodeFormat.EAN_8, ZXing.BarcodeFormat.EAN_13, ZXing.BarcodeFormat.QR_CODE };
options.DelayBetweenContinuousScans = 2000;
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
scanner.ScanContinuously(options, async x =>
{
        ````          Search scan item              ````

       Xamarin.Forms.Device.BeginInvokeOnMainThread(new Action(() =>
        {
                 // This will display untill terminate current scan
                 App.Current.MainPage.DisplayAlert("Show what I scan!");
       }));

});

It's all normal when use UWP and iOS, but Android, DisplayAlert message box will not show up until I cancel or go back to the previous page. (just like the camera page cover up the message box)

Is that a bug or a Android setting problem?? or Is there a way I can avoid it for Andoird?

knocte commented 3 years ago

What version of ZXing.Net.Mobile did you try?

huangjinshe commented 3 years ago

@knocte , The newest version when 2 Jun.

knocte commented 3 years ago

@huangjinshe beta(3.x) or stable(2.4.1)?

huangjinshe commented 3 years ago

@knocte stable(2.4.1)

knocte commented 3 years ago

@huangjinshe can you test with the 3.0 beta pre-release please?