Is there a way I can store the value retrieved from the Firebase to be stored in a String Variable? Here is my code retrieving the Value of "rface":
ref.addListenerForSingleValueEvent(new com.google.firebase.database.ValueEventListener() {
@Override
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
rface = dataSnapshot.child("face").getValue(String.class);
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
And I want to implement and if condition:
if (rface=="0") {
do this
}
The rface contains a string value in my Firebase Database.
When I try to use this If condition Android Studio says:
Operator "==" can not be applied to 'java.util.Objects','java.lang.String'