diff --git a/app/src/main/java/com/dougkeen/bart/activities/RoutesListActivity.java b/app/src/main/java/com/dougkeen/bart/activities/RoutesListActivity.java index e1e211d..9ad8ede 100644 --- a/app/src/main/java/com/dougkeen/bart/activities/RoutesListActivity.java +++ b/app/src/main/java/com/dougkeen/bart/activities/RoutesListActivity.java @@ -197,15 +197,13 @@ public class RoutesListActivity extends AppCompatActivity implements TickSubscri lastUpdate.setTimeZone(PACIFIC_TIME); // Update every day - if (now.get(Calendar.DAY_OF_YEAR) != lastUpdate - .get(Calendar.DAY_OF_YEAR) + if (now.get(Calendar.DAY_OF_YEAR) != lastUpdate.get(Calendar.DAY_OF_YEAR) || now.get(Calendar.YEAR) != lastUpdate.get(Calendar.YEAR)) { GetRouteFareTask fareTask = new GetRouteFareTask() { @Override public void onResult(String fare) { stationPair.setFare(fare); - stationPair.setFareLastUpdated(System - .currentTimeMillis()); + stationPair.setFareLastUpdated(System.currentTimeMillis()); getListAdapter().notifyDataSetChanged(); } diff --git a/app/src/main/java/com/dougkeen/bart/networktasks/FareContentHandler.java b/app/src/main/java/com/dougkeen/bart/networktasks/FareContentHandler.java index 285ded1..87ab48e 100644 --- a/app/src/main/java/com/dougkeen/bart/networktasks/FareContentHandler.java +++ b/app/src/main/java/com/dougkeen/bart/networktasks/FareContentHandler.java @@ -26,7 +26,9 @@ public class FareContentHandler extends DefaultHandler { for (int i = attributes.getLength() - 1; i >= 0; i--) { attributeMap.put(attributes.getLocalName(i), attributes.getValue(i)); } - if (attributeMap.containsKey("class") && attributeMap.get("class").equals("cash")) { + if (attributeMap.containsKey("class") + && attributeMap.get("class").equals("cash") + && attributeMap.get("amount") != null) { fare = "$" + attributeMap.get("amount"); } }