Reputation: 1
So I'm making an android app and want to show my Post based on the user that's logged in.
Does anyone know how to show Post that have the same String (in this case the string from the child 'fakultas') as the String in User (the child 'admin')? Thank you.
Upvotes: 0
Views: 25
Reputation: 161
Something like this perhaps
postsRef.orderByChild("fakultas").equalTo("Fak. tecknik")
Sample code :
@Override public void onChildAdded(DataSnapshot dataSnapshot, String prevChildKey) { System.out.println(dataSnapshot.getKey()); } // ... });```
Upvotes: 1