在一个非常简单Xamarin android APP
的情况下,我使用扫描条形码ZXing
然后处理结果。处理结果需要几秒钟的时间来处理,并且在我想显示一个ACR showLoading
时,但是当扫描仪/相机关闭时,活动指示器几乎立即隐藏。
如何在处理结果时保持显示加载打开?
清理后的代码:
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
}