This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Firebase userRef= new Firebase(USERS_LOCATION); | |
userRef.child(userId).addListenerForSingleValueEvent(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot snapshot) { | |
if (snapshot.getValue() !== null) { | |
//user exists, do something | |
} else { | |
//user does not exist, do something else | |
} | |
} |