在我的android应用程序上使用zxing扫描仪时出错
我正在删除一个android应用程序,我的主要类代码如下 但在启动相机前会显示错误。我怎样才能解决这个问题在我的android应用程序上使用zxing扫描仪时出错,android,zxing,barcode-scanner,Android,Zxing,Barcode Scanner,我正在删除一个android应用程序,我的主要类代码如下 但在启动相机前会显示错误。我怎样才能解决这个问题 public void onClick(View view) { Intent intent = new Intent("com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_FORMATS", "CODE_39,CODE_93,CODE_128,DATA_MATRIX,
public void onClick(View view) {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_FORMATS", "CODE_39,CODE_93,CODE_128,DATA_MATRIX,ITF,CODABAR");
startActivityForResult(intent, 0); //Barcode Scanner to scan for us
}
});
这是我的追踪
09-02 13:54:51.659 20660-20660/com.mehdi.BarCodeScanner I/ViewRootImpl﹕ ViewRoot's Touch Event : Touch Down
09-02 13:54:51.739 20660-20660/com.mehdi.BarCodeScanner I/ViewRootImpl﹕ ViewRoot's Touch Event : Touch UP
09-02 13:55:06.919 20660-20660/com.mehdi.BarCodeScanner D/AndroidRuntime﹕ Shutting down VM
09-02 13:55:06.919 20660-20660/com.mehdi.BarCodeScanner W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41813e48)
09-02 13:55:06.949 20660-20660/com.mehdi.BarCodeScanner E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.mehdi.BarCodeScanner, PID: 20660
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.google.zxing.client.android.SCAN }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
at android.app.Activity.startActivityForResult(Activity.java:3468)
at android.app.Activity.startActivityForResult(Activity.java:3429)
at com.mehdi.BarCodeScanner.main$2.onClick(main.java:106)
at android.view.View.performClick(View.java:4442)
at android.view.View$PerformClick.run(View.java:18473)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5105)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
android.content.ActivityNotFoundException:找不到处理意图的活动{act=com.google.zxing.client.android.SCAN}
在尝试通过Intent
使用ZXing应用程序之前,您需要先安装该应用程序
考虑使用自动检查和安装ZXIng应用程序的方法。:尝试在Android清单中添加摄像头权限。我这样做了,但我再次出错。请尝试本教程,它会有所帮助。bro!跟帖哪一个错误?你能分享stacktrace吗?我不想安装它,因为这是一个用于特定工作的应用程序,我们不能使用其他应用程序来实现这一点,如果没有它,请提供帮助,然后你需要更深入地集成一些条形码扫描仪库。不过,这一点太宽泛,无法在评论中提及。