So right now I'm using the zxing barcode scanner in my app. Here is example code(generic):
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");
// Handle successful scan
Intent i = new Intent(Main.this, BarcodeScanner.class);
startActivity(i);
} else if (resultCode == RESULT_CANCELED) {
// Handle cancel
}
}
}
So when launching the BarcodeScanner.class
, I also want to pass contents
into it. How would I go about doing that?