-
Notifications
You must be signed in to change notification settings - Fork 0
/
ResultActivity.java
42 lines (27 loc) · 930 Bytes
/
ResultActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.example.itcapstone.burglarkitten;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class ResultActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);
TextView textResult = (TextView) findViewById(R.id.textResult);
Bundle b = getIntent().getExtras();
int score = b.getInt("score");
if(score < 20) {
textResult.setText("Your score is" + " " + score + " out of 20. Thanks for playing.");
}
else{
textResult.setText("Congratulations. You got a perfect score.\nYou know so much about cats you should probably be one.");
}
}
public void playagain(View o) {
Intent intent = new Intent(this, QuestionActivity.class);
startActivity(intent);
finish();
}
}