21 |
import android.view.View; |
import android.view.View; |
22 |
import android.widget.ListView; |
import android.widget.ListView; |
23 |
import android.widget.TextView; |
import android.widget.TextView; |
24 |
|
import android.widget.Toast; |
25 |
import dk.thoerup.android.traininfo.common.DepartureEntry; |
import dk.thoerup.android.traininfo.common.DepartureEntry; |
26 |
import dk.thoerup.android.traininfo.common.StationBean.StationEntry; |
import dk.thoerup.android.traininfo.common.StationEntry; |
27 |
import dk.thoerup.android.traininfo.common.TimetableBean; |
import dk.thoerup.android.traininfo.common.TimetableBean; |
28 |
import dk.thoerup.android.traininfo.common.TimetableEntry; |
import dk.thoerup.android.traininfo.common.TimetableEntry; |
29 |
import dk.thoerup.traininfo.provider.ProviderFactory; |
import dk.thoerup.traininfo.provider.ProviderFactory; |
106 |
protected void onListItemClick(ListView l, View v, int position, long id) { |
protected void onListItemClick(ListView l, View v, int position, long id) { |
107 |
super.onListItemClick(l, v, position, id); |
super.onListItemClick(l, v, position, id); |
108 |
|
|
109 |
TimetableEntry tt = timetables.entries.get(position); |
if (timetables == null || timetables.entries == null || timetables.entries.size() == 0) { |
110 |
|
Toast.makeText(this, "No timetables in list !?", Toast.LENGTH_LONG).show(); //TODO Translate |
111 |
StationEntry station = new StationEntry(); |
return; |
112 |
station.setName( tt.getStation() ); |
} |
|
station.setId( tt.getStationId() ); |
|
|
station.setIsRegional(true); |
|
113 |
|
|
114 |
|
TimetableEntry tt = timetables.entries.get(position); |
115 |
|
|
116 |
|
|
117 |
Intent intent = new Intent(this, DepartureList.class); |
Intent intent = new Intent(this, DepartureList.class); |
118 |
intent.putExtra("stationbean", station); |
intent.putExtra("stationbean", tt.getStationEntry() ); |
119 |
startActivity(intent); |
startActivity(intent); |
120 |
|
|
121 |
} |
} |
187 |
super.onPostExecute(result); |
super.onPostExecute(result); |
188 |
dismissDialog(DLG_PROGRESS); |
dismissDialog(DLG_PROGRESS); |
189 |
|
|
190 |
//TODO: differentiate between a communication error and a downed bane.dk site |
|
191 |
if (timetables != null && timetables.errorCode == null) { |
if (timetables != null && timetables.errorCode == null) { |
192 |
commFailCounter = 0; |
commFailCounter = 0; |
193 |
TimetableList.this.getListView().invalidateViews(); |
TimetableList.this.getListView().invalidateViews(); |