public List<Arrival> getNearestBuses(final Context ctx) throws Exception { List<Stop> stopList = BusInformation.getClosestStops(this.getDeviceLocation(ctx)); List<Arrival> arrivalList = new ArrayList<Arrival>(); for (int i = 0; i < stopList.size() && i < 5; i++) { arrivalList.addAll(BusInformation.getStopTimetable(stopList.get(i))); } Collections.sort(arrivalList, Arrival.compare_by_time); return arrivalList; }
public static List<Arrival> getBusTimetable(final Arrival arrival) { return BusInformation.getBusTimetable(arrival); }