-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappointCR.java
More file actions
19 lines (17 loc) · 927 Bytes
/
appointCR.java
File metadata and controls
19 lines (17 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public void appointCr(final String studentId) {
final DatabaseReference mRoot, mDatabase;
mRoot = FirebaseDatabase.getInstance().getReference().child("app");
mDatabase = mRoot.child("cr");
mRoot.child("users").child("students").child(studentId).child("tag").setValue("CR").addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
mDatabase.child(studentId).child("extra").setValue("default").addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful())
Toast.makeText(getApplicationContext(), "CR successfully assigned", Toast.LENGTH_LONG).show();
}
});
}
});
}