Forum Xamarin.Android

ZXingBarcodeScanner problems - NullPointerReference

Hello world!

I'm trying to use the ZXing for Mono for Android in my project. I've used this code to call my scanner/camera, however it crashes on

ZXing.Result result = await _scanner.Scan();

With result being NULL. I get a "Java.Lang.NullPointerException".


    `private async void _imgbtnScan_Click(object sender, EventArgs e)

        _scanner.UseCustomOverlay = false;

        _scanner.TopText = "TEMP TEMP";
        _scanner.BottomText = "TEMP TEMP";

        ZXing.Result result = await _scanner.Scan();



    private void HandleScanResult(ZXing.Result result)
        string msg = string.Empty;

        if (result != null && !string.IsNullOrEmpty(result.Text))
            msg = result.Text;

        _scanResult = msg;


Sign In or Register to comment.