-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame1Score.java
47 lines (39 loc) · 1.39 KB
/
Game1Score.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
43
44
45
46
47
package com.application.brainfit;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class Game1Score extends AppCompatActivity {
TextView tv2;
Button rebtn, hbtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game1_score);
tv2 = (TextView) findViewById(R.id.tv2);
rebtn = (Button) findViewById(R.id.rebtn);
hbtn = (Button) findViewById(R.id.hbtn);
Intent i = getIntent();
int score = i.getIntExtra("n",0);
String msg = score+" Points";
tv2.setText(msg);
rebtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(), Game1.class);
startActivity(i);
finish();
}
});
hbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(), Exercise.class);
startActivity(i);
finish();
}
});
}
}