I am sending "Appetizers and Snacks" which is in name
key from one activity 1 to activity 2.
In activity 2,the data received is simply :
databaseReference = FirebaseDatabase.getInstance().getReference();
val ref = database.child("All Categories").child("0").child("recipes")
val valueEventListener = object : ValueEventListener {
override fun onDataChange(dataSnapshot: DataSnapshot) {
val recipes = dataSnapshot.getValue(Recipes::class.java) // recipes model reading
}
override fun onCancelled(databaseError: DatabaseError) {
}
}
ref.addListenerForSingleValueEvent(valueEventListener)