Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/middleware/AsyncDataDownload.java
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | protected Object doInBackground(String... params) { | ||||
stopID=params[0]; //(it's a Palina) | stopID=params[0]; //(it's a Palina) | ||||
else if(lastSearchedBusStop!=null) | else if(lastSearchedBusStop!=null) | ||||
stopID = lastSearchedBusStop.ID; //(it's a Palina) | stopID = lastSearchedBusStop.ID; //(it's a Palina) | ||||
else { | else { | ||||
publishProgress(Fetcher.Result.QUERY_TOO_SHORT); | publishProgress(Fetcher.Result.QUERY_TOO_SHORT); | ||||
return null; | return null; | ||||
} | } | ||||
//Skip the FiveTAPIFetcher for the Metro Stops because it shows incomprehensible arrival times | //Skip the FiveTAPIFetcher for the Metro Stops because it shows incomprehensible arrival times | ||||
try { | |||||
if(f instanceof FiveTAPIFetcher && Integer.parseInt(stopID)>= 8200) | if (f instanceof FiveTAPIFetcher && Integer.parseInt(stopID) >= 8200) | ||||
continue; | continue; | ||||
} catch (NumberFormatException ex){ | |||||
Log.e(DEBUG_TAG, "The stop number is not a valid integer, expect failures"); | |||||
} | |||||
p= f.ReadArrivalTimesAll(stopID,res); | p= f.ReadArrivalTimesAll(stopID,res); | ||||
publishProgress(res.get()); | publishProgress(res.get()); | ||||
//if (res.get()!= Fetcher.Result.OK) | //if (res.get()!= Fetcher.Result.OK) | ||||
Log.d(DEBUG_TAG, "Arrivals fetcher: "+f+"\n\tProgress: "+res.get()); | Log.d(DEBUG_TAG, "Arrivals fetcher: "+f+"\n\tProgress: "+res.get()); | ||||
if(f instanceof FiveTAPIFetcher){ | if(f instanceof FiveTAPIFetcher){ | ||||
AtomicReference<Fetcher.Result> gres = new AtomicReference<>(); | AtomicReference<Fetcher.Result> gres = new AtomicReference<>(); | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register