目前为止,我将第一个链接中的类复制到我的项目中(进行了一些包名称更改),它可以运行,但在按下按钮并尝试安装条形码扫描器后崩溃。
一些代码:
private void setScanButton(){
Button scan = (Button) findViewById(R.id.MainPageScanButton);
scan.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
IntentIntegrator.initiateScan(MyActivity.this);
}
});
}
从logcat中得到的错误结果:
06-13 15:26:01.540: ERROR/AndroidRuntime(1423): Uncaught handler: thread main exiting due to uncaught exception
06-13 15:26:01.560: ERROR/AndroidRuntime(1423): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://search?q=pname:com.google.zxing.client.android }
有什么想法?