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 |
|
|
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 |
|
|
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 |
|
|
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 ) { |
182 |
dismissDialog(DLG_PROGRESS); |
dismissDialog(DLG_PROGRESS); |
183 |
|
|
184 |
startLocatorTask(); |
startLocatorTask(); |
185 |
|
location = GeoPair.fromLocation( locator.getLocation() ); |
186 |
|
|
187 |
break; |
break; |
188 |
|
|