/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/TimetableList.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/TimetableList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1408 by torben, Mon May 2 11:54:17 2011 UTC revision 1551 by torben, Thu Jul 7 20:45:17 2011 UTC
# Line 21  import android.util.Log; Line 21  import android.util.Log;
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;
 import dk.thoerup.android.traininfo.common.StationEntry;  
26  import dk.thoerup.android.traininfo.common.TimetableBean;  import dk.thoerup.android.traininfo.common.TimetableBean;
27  import dk.thoerup.android.traininfo.common.TimetableEntry;  import dk.thoerup.android.traininfo.common.TimetableEntry;
28  import dk.thoerup.traininfo.provider.ProviderFactory;  import dk.thoerup.traininfo.provider.ProviderFactory;
# Line 105  public class TimetableList extends ListA Line 105  public class TimetableList extends ListA
105          protected void onListItemClick(ListView l, View v, int position, long id) {          protected void onListItemClick(ListView l, View v, int position, long id) {
106                  super.onListItemClick(l, v, position, id);                  super.onListItemClick(l, v, position, id);
107    
108                  TimetableEntry tt = timetables.entries.get(position);                  if (timetables == null || timetables.entries == null || timetables.entries.size() == 0) {
109                                            Toast.makeText(this, "No timetables in list !?", Toast.LENGTH_LONG).show(); //TODO Translate
110                  StationEntry station = new StationEntry();                          return;
111                  station.setName( tt.getStation() );                  }
                 station.setId( tt.getStationId() );  
                 station.setIsRegional(true);  
112                                    
113                    TimetableEntry tt = timetables.entries.get(position);
114                                                    
115                                    
116                  Intent intent = new Intent(this, DepartureList.class);                  Intent intent = new Intent(this, DepartureList.class);
117                  intent.putExtra("stationbean", station);                  intent.putExtra("stationbean", tt.getStationEntry() );
118                  startActivity(intent);                  startActivity(intent);
119                                    
120          }          }
# Line 186  public class TimetableList extends ListA Line 186  public class TimetableList extends ListA
186                          super.onPostExecute(result);                          super.onPostExecute(result);
187                          dismissDialog(DLG_PROGRESS);                          dismissDialog(DLG_PROGRESS);
188                    
189                          //TODO: differentiate between a communication error and a downed bane.dk site    
190                          if (timetables != null && timetables.errorCode == null) {                          if (timetables != null && timetables.errorCode == null) {
191                                  commFailCounter = 0;                                  commFailCounter = 0;
192                                  TimetableList.this.getListView().invalidateViews();                                  TimetableList.this.getListView().invalidateViews();

Legend:
Removed from v.1408  
changed lines
  Added in v.1551

  ViewVC Help
Powered by ViewVC 1.1.20