Created
December 10, 2014 06:42
-
-
Save visalig/6716d24f6ff01f15a87c to your computer and use it in GitHub Desktop.
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 | |
} | |
} | |
@Override | |
public void onCancelled(FirebaseError arg0) { | |
} | |
}); | |
Single user this is ok, but how to compare the more than one user? | |
I try below type thats not working can u anyone give me a idea for this | |
Firebase ref= new Firebase(USERS_LOCATION); | |
ref.addValueEventListener(new ValueEventListener() { | |
public void onDataChange(DataSnapshot snapshot) { | |
if (snapshot.getValue() !== null) { | |
//user exists, do something | |
} else { | |
//user does not exist, do something else | |
} | |
} | |
@Override | |
public void onCancelled(FirebaseError arg0) { | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what i should i do right now