public void DidScanBarcode(string barcode, string symbology) { Console.WriteLine("barcode scanned: {0}, '{1}'", symbology, barcode); // stop the camera picker.StopScanning(); AlertDialog alert = new AlertDialog.Builder(this) .SetTitle(symbology + " Barcode Detected") .SetMessage(barcode) .SetPositiveButton("OK", delegate { picker.StartScanning(); }) .Create(); alert.Show(); }
public void DidScanBarcode(string barcode, string symbology) { Console.WriteLine("barcode scanned: {0}, '{1}'", symbology, barcode); // Call GC.Collect() before stopping the scanner as the garbage collector for some reason does not // collect objects without references asap but waits for a long time until finally collecting them. GC.Collect(); // stop the camera picker.StopScanning(); AlertDialog alert = new AlertDialog.Builder(this) .SetTitle(symbology + " Barcode Detected") .SetMessage(barcode) .SetPositiveButton("OK", delegate { picker.StartScanning(); }) .Create(); alert.Show(); }
protected override void OnResume() { picker.StartScanning(); base.OnResume(); }