0

Here is my code :

if(radioButton_correct1e.isChecked()) {
     score++;
     scoreText.setText(Integer.toString(score));
}

the result is then shown in textView. This is the same for activity A & B . So how can i add results for both activities and show in activity C?

Jon
  • 9,156
  • 9
  • 56
  • 73

1 Answers1

0
Intent intent = new Intent(ActivityAB.this, ActivityC.class);
intent.putExtra("score",score);
startActivity(intent);

And to get it in ActivityC in onCreate.

Intent intent = getIntent();
int score = intent.getIntExtra("score",0);
M.Waqas Pervez
  • 2,492
  • 2
  • 19
  • 33
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123