0
Google 유리 프로젝트에서 스캔 라이브러리를 구현했지만 EAN-13 바코드를 스캔하는 경우 마지막 숫자가 항상 잘못되었습니다. 예를 들어 : 나는 값 2,220,141,633,626와 코드를 스캔하고있어 그 결과는 2220141633624.Android - Scandit 바코드 스캐너 문제가 EAN-13
이는 활동 1 내 코드입니다 :
:public void didScanBarcode(String content, String format) {
// send the result to another activity.
Intent resultIntent = new Intent(this, TestingActivity.class);
resultIntent.putExtra("scanContent", content);
Log.v("scanbarcode", content);
startActivity(resultIntent);
}
이것은 활동이 내 코드입니다
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.testing);
Intent resultIntent = getIntent();
String scanContent = resultIntent.getExtras().getString("scanContent");
serialNumber = Long.parseLong(scanContent);
Log.e("string ", "" + scanContent);
Log.e("long ", "" + serialNumber);
}
첫 번째 활동의 didScanBarcode 메소드의 내용이 이미 잘못되었습니다.