如何在扫描QRcode后打开新活动,其中每个QRcode都有一个活动。这是我的代码
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null){
if(result.getContents() == null){
Toast.makeText(this, "sambel sere", Toast.LENGTH_LONG).show();
}
else if(resultCode == RESULT_OK) {
String contents = data.getStringExtra("SCAN_RESULT");
Intent inten = new Intent(ReaderActivity.this, sambel.class);
startActivity(inten);
Toast.makeText(this, result.getContents(), Toast.LENGTH_LONG).show();
}
}
else {
super.onActivityResult(requestCode, resultCode, data);
}