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
  • 8,205
  • 6
  • 53
  • 71

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,460
  • 2
  • 20
  • 32
Denis Sologub
  • 6,511
  • 9
  • 47
  • 94