Ejemplo n.º 1
0
        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();

            /* Create new result intent */
            Intent reply = new Intent();

            reply.PutExtra("barcode", barcode);
            reply.PutExtra("symbology", symbology);
            SetResult(Result.Ok, reply);
            Finish();   // Close this activity
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
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();
        }