-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.java
46 lines (38 loc) · 1.42 KB
/
MainPage.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
package com.example.tlee1.petmanager;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainPage extends AppCompatActivity {
private static Button button_pet;
private static Button button_fitness;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_page);
onClickListener();
}
public void onClickListener() {
button_fitness = (Button) findViewById(R.id.buttonFitness);
button_fitness.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainPage.this, Petfitness.class);
startActivity(intent);
}
}
);
button_pet = (Button) findViewById(R.id.buttonPet);
button_pet.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainPage.this, PetInfo.class);
startActivity(intent);
}
}
);
}
}