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

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

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

revision 373 by torben, Wed Sep 30 19:09:59 2009 UTC revision 374 by torben, Wed Sep 30 20:38:47 2009 UTC
# Line 48  public class StationList extends ListAct Line 48  public class StationList extends ListAct
48          LocationLookup locator = null;          LocationLookup locator = null;
49          LocatorTask locatorTask;          LocatorTask locatorTask;
50                    
51            GeoPair location = new GeoPair();
52            
53          boolean isRunning = false;          boolean isRunning = false;
54          List<StationBean> stations = new ArrayList<StationBean>();          List<StationBean> stations = new ArrayList<StationBean>();
55                    
# Line 71  public class StationList extends ListAct Line 73  public class StationList extends ListAct
73                  } else {                  } else {
74                          stations = (ArrayList<StationBean>) savedInstanceState.getSerializable("stations");                          stations = (ArrayList<StationBean>) savedInstanceState.getSerializable("stations");
75                          adapter.setStations(stations);                          adapter.setStations(stations);
76                            location = (GeoPair) savedInstanceState.getSerializable("location");
77                  }                  }
78          }          }
79    
# Line 81  public class StationList extends ListAct Line 84  public class StationList extends ListAct
84          if (dialog != null && dialog.isShowing())          if (dialog != null && dialog.isShowing())
85                  dialog.dismiss();                  dialog.dismiss();
86          outState.putSerializable("stations", (ArrayList<StationBean>) stations);          outState.putSerializable("stations", (ArrayList<StationBean>) stations);
87            outState.putSerializable("location", location);
88      }      }
89                    
90                    
# Line 101  public class StationList extends ListAct Line 105  public class StationList extends ListAct
105                  case OPTIONS_MAP:                  case OPTIONS_MAP:
106                                                    
107                          Intent intent = new Intent(this,StationMapView.class);                          Intent intent = new Intent(this,StationMapView.class);
108                          intent.putExtra("userlocation", GeoPair.fromLocation(locator.getLocation()) );                          intent.putExtra("userlocation", location );
109                                                    
110                          ArrayList<GeoPair> stationPoints = new ArrayList<GeoPair>();                          ArrayList<GeoPair> stationPoints = new ArrayList<GeoPair>();
111                          for (StationBean st : stations ) {                          for (StationBean st : stations ) {
# Line 178  public class StationList extends ListAct Line 182  public class StationList extends ListAct
182                                  dismissDialog(DLG_PROGRESS);                                  dismissDialog(DLG_PROGRESS);
183                                                                    
184                                  startLocatorTask();                                  startLocatorTask();
185                                    location = GeoPair.fromLocation( locator.getLocation() );
186                                                                    
187                                  break;                                  break;
188    

Legend:
Removed from v.373  
changed lines
  Added in v.374

  ViewVC Help
Powered by ViewVC 1.1.20