你把扫描之后得到数据那行代码找到
进行相关操作(比如跳转)
如果没记错的话,将扫描结果显示出来的操作也是在1那行代码后面进行的
/**
* 处理扫描结果
*
* @param result
* @param barcode
*/
public void handleDecode(Result result, Bitmap barcode) {
inactivityTimer.onActivity();
playBeepSoundAndVibrate();
// HashMaphashMap = new HashMap ();
// String phoneNum = (String) hashMap.get("phoneNum");
// int shorpId = (Integer) hashMap.get("shorpId");
// String phoneNum=(String) result.getResultMetadata().get("phoneNum");
// int shorpId =(Integer) result.getResultMetadata().get("shorpId");
String longtext = result.getText();
String[] longtext1 = longtext.split("\\-");
// 电话号码
String phoneNum = longtext1[0];
// 用户id
int shorpId = Integer.parseInt(longtext1[1]);
System.out.println("phoneNum:" + phoneNum);
// System.out.println("shorpId:" + shorpId);
// UserManager.getInstance().setErweimaId(shorpId);
// UserManager.getInstance().setErweimaPhoneNum(phoneNum);
if (phoneNum.equals("")) {
Toast.makeText(MipcaActivityCapture.this, "Scan failed!",
Toast.LENGTH_SHORT).show();
} else {
Intent resultIntent = new Intent();
Bundle bundle = new Bundle();
bundle.putString("result", phoneNum);
// bundle.putParcelable("bitmap", barcode);
resultIntent.putExtras(bundle);
this.setResult(RESULT_OK, resultIntent);
}
MipcaActivityCapture.this.finish();
// openActivityIn(InputMoneyActivity.class);
}