40 |
import dk.thoerup.traininfo.provider.MetroProvider; |
import dk.thoerup.traininfo.provider.MetroProvider; |
41 |
import dk.thoerup.traininfo.provider.ProviderFactory; |
import dk.thoerup.traininfo.provider.ProviderFactory; |
42 |
import dk.thoerup.traininfo.util.MessageBox; |
import dk.thoerup.traininfo.util.MessageBox; |
43 |
|
import dk.thoerup.traininfo.util.StationEntryCsv; |
44 |
|
|
45 |
public class DepartureList extends ListActivity { |
public class DepartureList extends ListActivity { |
46 |
|
|
196 |
|
|
197 |
ProviderFactory.purgeOldEntries(); //cleanup before fetching more data |
ProviderFactory.purgeOldEntries(); //cleanup before fetching more data |
198 |
|
|
199 |
Log.e("Station", station.toCSV() ); |
Log.e("Station", StationEntryCsv.toCSV(station) ); |
200 |
|
|
201 |
|
|
202 |
|
|
315 |
protected void onListItemClick(ListView l, View v, int position, long id) { |
protected void onListItemClick(ListView l, View v, int position, long id) { |
316 |
super.onListItemClick(l, v, position, id); |
super.onListItemClick(l, v, position, id); |
317 |
|
|
318 |
|
//how can this happen ?? |
319 |
|
if (departures == null || departures.entries == null || departures.entries.size() == 0) { |
320 |
|
Toast.makeText(this, "No departures in list ?!?", Toast.LENGTH_LONG).show(); //TODO: translate |
321 |
|
return; |
322 |
|
} |
323 |
|
|
324 |
selectedItemId = position; |
selectedItemId = position; |
325 |
|
|
326 |
DepartureEntry dep = departures.entries.get(selectedItemId); |
DepartureEntry dep = departures.entries.get(selectedItemId); |