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".
Ideas?
`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(); HandleScanResult(result); } private void HandleScanResult(ZXing.Result result) { string msg = string.Empty; if (result != null && !string.IsNullOrEmpty(result.Text)) msg = result.Text; _scanResult = msg; }`
Posts
Nevermind, I figured it out. I didn't put the activity as the context but a context as context (hope that makes sense).