【发布时间】:2011-12-26 17:30:54
【问题描述】:
我使用 PhoneGap 构建了一个简单的应用程序,并尝试使用以下代码打开条形码扫描仪:
var scanCode = function() {
window.plugins.barcodeScanner.scan(
function(result) {
alert("Scanned Code: " + result.text
+ ". Format: " + result.format
+ ". Cancelled: " + result.cancelled);
}, function(error) {
alert("Scan failed: " + error);
});
}
当我调用这个函数时,我得到一个错误:
Scan failed: No Activity found to handle Intent {act=com.phonegap.plugins.barcodescanner.SCAN cat=[android.category.DEFAULT]}
我还在日志中注意到以下错误:
11-10 21:32:50.830: I/Database(1052): sqlite returned: error code = 14, msg = cannot open file at source line 25467
我已经在这个问题上纠结了好几个小时。任何人都可以提供建议吗?顺便说一句,我正在使用手机进行测试,而不是模拟器。
【问题讨论】: