I am using firebase to store information into the database to store favorites. I basically have a listview and when you click on an item it will take you to a new activity. I wa
Change this:
if ((myRef.child("Favorites").child(itemName.toLowerCase())).equals(itemName.toLowerCase())) {
To this:
FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
DatabaseReference myRef = firebaseDatabase.getReference(firebaseAuth.getCurrentUser().getUid());
Query queries=myRef.child("ItemName").orderByChild("name").equals(itemName);
You need to use orderByChild("name").equals(itemName)
to check if the child in the database has that value. Also the child(child_here)
needs to be the same name as in the database.
More info here