In a very simple Xamarin android APP
I scan a barcode with ZXing
and then handle the result. The handle results takes a few seconds to process and during I want to show an ACR showLoading
, but the activity indicator hides almost instantly when the scanner/camera is closed.
How can I keep the show loading open while it is handling the result?
Cleaned code:
async void onAddByScan(object sender, EventArgs e)
{
var options = new ZXing.Mobile.MobileBarcodeScanningOptions();
var scanner = new MobileBarcodeScanner();
ZXing.Result result = await scanner.Scan(options);
using (UserDialogs.Instance.Loading())
{
await HandleResultAsync(result);
}
}
async Task HandleResultAsync(ZXing.Result result)
{
//do something with the results
}