-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomepage.java
More file actions
54 lines (42 loc) · 1.68 KB
/
Copy pathHomepage.java
File metadata and controls
54 lines (42 loc) · 1.68 KB
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
48
49
50
51
52
53
54
package com.example.practicemapapp;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.content.Intent;
public class Homepage extends Activity{
Button login; // button is login button
Button register; // button2 is register button
Button viewMapButton; // button3 is view map button
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.homepage);
// button listener for the login button
login = findViewById(R.id.button);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent viewUserpass = new Intent(Homepage.this, Userpass.class);
startActivity(viewUserpass);
}
});
// button listener for the register button
register = findViewById(R.id.button2);
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent viewNewUser = new Intent(Homepage.this, Newuser.class);
startActivity(viewNewUser);
}
});
// button listener for the view map button on the homepage
viewMapButton = findViewById(R.id.button3);
viewMapButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intentViewMap = new Intent(Homepage.this, MainActivity.class);
startActivity(intentViewMap);
}
});
}
}