I want to populate recyclerview so i can use it for displaying posts.
This is how i populate recycler view: How can I retrieve data from Firebase to my adapter
But depending on which country user is, i need to filter posts related to just his country.
In database structure, TO, FROM, PASSING, REQUEST FROM are what i need to filter. Because in those parameters i put country code, so i can filter just country where user is.
Can i just add this in query, and will i be able to retrieve other information from child, so i can display it in post when user click on post in recyclerview.
DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference(); Query query = rootRef.child("Trading info").orderbyChild("TO location").equals(USA);
So if child contains USA, it will be showed in post, and when user click on post, will i be able to retrieve all data as i would normally.
Sorry if not best explained. I want to know, will i be able to retrieve all other child nodes from filtered child nodes. To retrieve nodes from child node which contains USA in their child nodes.
And can use multiple queries, because i need to check FROM, PASSING, TO and REQUEST FROM location child nodes, if it contains country code i need.