I am trying to code a Search function in my App. Data is fetched from Firebase Database.
This is what the DB structure looks like at the Root
Node :
After Expanding the items
node, this is the DB structure :
I am trying to get the name
node which is inside the items
node. How can i do that ?
So, far I have tried this:
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("HomeItems");
databaseReference.keepSynced(true);
options = new FirebaseRecyclerOptions.Builder<HomeModel>()
.setQuery(FirebaseDatabase.getInstance().getReference("HomeItems").orderByChild("name").startAt(String.valueOf(editable)).endAt(editable + "\uf8ff"), HomeModel.class)
.build();
Log.e("afterTextChanged: ", String.valueOf(options.getSnapshots()));
recyclerView.setLayoutManager(new GridLayoutManager(SearchActivity.this, 3));
homeAdapter = new HomeAdapter(options, SearchActivity.this);
homeAdapter.startListening();
recyclerView.setAdapter(homeAdapter);
The current Output gives the values of the Direct node of name
. But, how do I get the same for the nodes which are inside the items
node?