-2

I'm currently working on QR code scanner. I want to ask if it is possible to open another activity after the QR code have been scanned rather than getting it displayed as a toast?

I've solved the problem already .Thank you guys, I'm sorry for asking for such a simple question. I'm really new to android programming.

public void scanResult(ScanResult result) {

      Toast.makeText(this, result.getRawResult().getText(), Toast.LENGTH_LONG).show();

 }
Tan Chong Kai
  • 333
  • 1
  • 4
  • 16
  • 1
    Then what is problem? have you tried to start Activity in `scanResult ` ? – ρяσѕρєя K Sep 07 '15 at 06:06
  • 1
    Use `Intent` and start another activity – Rustam Sep 07 '15 at 06:12
  • 1
    Are you getting any error??? If not then just use intent to start a new Activity. – Pankaj Sep 07 '15 at 06:16
  • 1
    take a look at this questions this might help you ... http://stackoverflow.com/questions/8831050/android-how-to-read-qr-code-in-my-application http://stackoverflow.com/questions/10258633/android-start-application-from-qr-code-with-params – Umair Sep 07 '15 at 06:17

1 Answers1

2

Why not? What seems to be the problem? In which file is your scanResult located/ do you have access to the Context?

As normal just use

Intent intent = new Intent(MyActivity.this, StartThisActivity.class);
startActivity(intent);
Marko
  • 19,347
  • 13
  • 45
  • 61