-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfile.java
More file actions
112 lines (77 loc) · 2.87 KB
/
Profile.java
File metadata and controls
112 lines (77 loc) · 2.87 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package com.example.tomap.loginreal;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Button;
import android.view.View;
import android.content.Intent;
import android.widget.EditText;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.UserInfo;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
public class Profile extends AppCompatActivity {
final FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference ref = database.getReference("server/saving-data/fireblog");
FirebaseAuth firebaseauth;
FirebaseUser user = firebaseauth.getCurrentUser();
TextView name;
TextView age;
TextView instrument;
TextView genre;
TextView skill;
@Override
protected void onCreate(Bundle savedInstanceState) {
firebaseauth = FirebaseAuth.getInstance();
super.onCreate(savedInstanceState);
setContentView(R.layout.profile);
name = findViewById(R.id.NameBox);
RegisterName();
age = findViewById(R.id.AgeBox);
RegisterAge();
instrument = findViewById(R.id.InstrumentBox);
RegisterInstrument();
genre = findViewById(R.id.GenreBox);
RegisterGenre();
skill = findViewById(R.id.SkillBox);
RegisterSkill();
}
public void RegisterName() {
name.setText(name.getText());
}
public void RegisterAge() {
age.setText(age.getText());
}
public void RegisterInstrument() {
instrument.setText(instrument.getText());
}
public void RegisterGenre() {
genre.setText(genre.getText());
}
public void RegisterSkill() {
skill.setText(skill.getText());
}
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("Home")) {
Intent switchToHome = new Intent(this, Home.class);
startActivity(switchToHome);
}
else if (button_text.equals("Edit")) {
Intent switchToProfileEdit = new Intent(this, ProfileEdit.class);
startActivity(switchToProfileEdit);
}
}
}