-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.java
More file actions
44 lines (29 loc) · 1.08 KB
/
Home.java
File metadata and controls
44 lines (29 loc) · 1.08 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
package com.example.tomap.loginreal;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.view.View;
import android.content.Intent;
public class Home extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
}
public void Switch(View View) {
String button_text;
button_text =((Button)View).getText().toString();
if(button_text.equals("Search")) {
Intent switchToSearch = new Intent(this, Search.class);
startActivity(switchToSearch);
}
else if (button_text.equals("Profile")) {
Intent switchToProfile = new Intent(this, Profile.class);
startActivity(switchToProfile);
}
else if (button_text.equals("Settings")) {
Intent switchToSettings = new Intent(this, Settings.class);
startActivity(switchToSettings);
}
}
}