Skip to content

Commit

Permalink
Fixed Search by Food
Browse files Browse the repository at this point in the history
  • Loading branch information
saumeel committed May 1, 2017
1 parent f496c3b commit 2e8d11e
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void onDataChange(DataSnapshot dataSnapshot) {
foodList.clear();
Iterable<DataSnapshot> users = dataSnapshot.getChildren();
for (DataSnapshot user : users) {
DataSnapshot name = user.child("Name of Food Truck");
DataSnapshot name = user.child("Name Of Food Truck");
DataSnapshot type = user.child("Type");


Expand All @@ -112,10 +112,9 @@ public void onDataChange(DataSnapshot dataSnapshot) {
if (uniqueID.getValue() == null){
continue;
}
if (((String)TOF.getValue()).equalsIgnoreCase(queryUsable)){
foodList.put(name.getValue(String.class),uniqueID.getValue(String.class));
}
else {
if (((String)TOF.getValue()).equalsIgnoreCase(queryUsable)) {
foodList.put(name.getValue(String.class), uniqueID.getValue(String.class));
} else {
DataSnapshot menuItems = user.child("Menu");
if (menuItems.getValue() == null){
continue;
Expand All @@ -124,7 +123,7 @@ public void onDataChange(DataSnapshot dataSnapshot) {
if (values != null) {
for (String item : values.keySet()) {
if (item.equalsIgnoreCase(queryUsable)) {
foodList.put(name.getValue(String.class),uniqueID.getValue(String.class));
foodList.put(name.getValue(String.class), uniqueID.getValue(String.class));
}
}
}
Expand All @@ -134,7 +133,6 @@ public void onDataChange(DataSnapshot dataSnapshot) {

setListView();
}

@Override
public void onCancelled(DatabaseError databaseError) {

Expand Down

0 comments on commit 2e8d11e

Please sign in to comment.