So now I am using the zxing barcode scanner in my application. Here is a sample code (general):
if(position == 0){
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
contents = intent.getStringExtra("SCAN_RESULT");
format = intent.getStringExtra("SCAN_RESULT_FORMAT");
Intent i = new Intent(Main.this, BarcodeScanner.class);
startActivity(i);
} else if (resultCode == RESULT_CANCELED) {
}
}
}
Therefore, at startup, BarcodeScanner.classI also want to pass contentsinto it. How should I do it?
James source
share