In my Android APP, whenever I need to call many different ActivitiesForResult from the same Activity, I do it like this:
public void firstMethod() {
int requestCode = 1;
Intent intent = new Intent(SomeCode1.class);
startActivityForResult(intent,requestCode);
}
public void secondMethod() {
int requestCode = 2;
Intent intent = new Intent(SomeCode2.class);
startActivityForResult(intent,requestCode);
}
And to know which intent it came from, I recognize them like this:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case 1: {
// some code
} case 2: {
// some code
}
}
I am trying to call the ZXING barcode Scanner twice from the same activity, and I do not know how to set a request code with it.
IntentIntegrator intentintegrator= new IntentIntegrator(this);
IntentIntegrator.initiateScan(ZxingIntent.QR_CODE_TYPES);
Does anybody know how to accomplish this? Do I need to modify the IntentIntegrator code?