我使用第 3 方库( Zxing
) 进行条码扫描。扫描的结果是null
。扫描后我尝试将结果添加到 alabel
但结果是null
.
这是我的代码:
if (requestCode === SCANNER_REQUEST_CODE && resultCode === android.app.Activity.RESULT_OK) {
// Handle successful scan
var contents = intent.getStringExtra("SCAN_RESULT");
var format = intent.getStringExtra("SCAN_RESULT_FORMAT");
// var scanned = page.getViewById("scanned");
//scanned.url = "";
pageData.set("message", contents);
page.bindingContext = pageData;
}