To call a new activity when a QRCode has been scanned, you must use an intent in the onActivityResult:
public void onActivityResult(int requestCode, int resultCode, Intent intent){
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null){
Intent newactivity = new Intent(ThisClass.this, NextActivity.class);
startActivity(newactivity);
}
}
If you want to parse or validate the scaned QRcode first, you can do the following:
String contents = intent.getStringExtra("SCAN_RESULT");
Then you can compare contents with your expected string:
if(contents.equals("CorrectScan")) { .......