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();
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
 protected override void OnResume()
 {
     picker.StartScanning();
     base.OnResume();
 }