我想在My Code中爲Zxing Bar掃描提供2個選項。Android - 如何禁用ZXing庫中的QR碼掃描並僅允許條碼掃描
選項:
- 掃描條形碼
- 掃描QR碼。
選擇第一個選項後,只有條碼應該被ZXing Library掃描,而且選項2也是一樣。
如果Zxing中有任何標誌位在Zxing中以啓用和禁用,請幫助我解決問題。
我想在My Code中爲Zxing Bar掃描提供2個選項。Android - 如何禁用ZXing庫中的QR碼掃描並僅允許條碼掃描
選項:
選擇第一個選項後,只有條碼應該被ZXing Library掃描,而且選項2也是一樣。
如果Zxing中有任何標誌位在Zxing中以啓用和禁用,請幫助我解決問題。
我已經測試了它的工作對我來說
對QR碼掃描使用
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
integrator.setPrompt("Scan a Qr code");
integrator.setCameraId(0); // Use a specific camera of the device
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
和條形碼使用
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
integrator.setPrompt("Scan a barcode");
integrator.setCameraId(0); // Use a specific camera of the device
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
謝謝哥們,但我沒有使用IntentIntegrator –
對於掃描QR碼:
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
對於掃描條碼:
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
我使用意向意圖=新意圖(「com.google.zxing.client。 android.SCAN「); intent.putExtra(「SCAN_MODE」,「QR_CODE_MODE」);但我仍然可以捕獲條形碼。 –
具有u嘗試任何事情 – Anil