掃描二維碼條形碼
作者:han313507443
掃描二維碼條形碼,簡單實用,值得借鑒
源碼簡介:掃描二維碼條形碼,簡單實用,值得借鑒
源碼效果:
源碼片段:
- /**
- * 處理掃描結(jié)果
- * @param result
- * @param barcode
- */
- public void handleDecode(Result result, Bitmap barcode) {
- inactivityTimer.onActivity();
- playBeepSoundAndVibrate();
- String resultString = result.getText();
- if (resultString.equals("")) {
- Toast.makeText(MipcaActivityCapture.this, "Scan failed!", Toast.LENGTH_SHORT).show();
- }else {
- Intent resultIntent = new Intent();
- Bundle bundle = new Bundle();
- bundle.putString("result", resultString);
- bundle.putParcelable("bitmap", barcode);
- resultIntent.putExtras(bundle);
- this.setResult(RESULT_OK, resultIntent);
- }
- MipcaActivityCapture.this.finish();
- }
責(zé)任編輯:倪明
來源:
devstore