135 |
|
|
136 |
ProviderFactory.purgeOldEntries(); //cleanup before fetching more data |
ProviderFactory.purgeOldEntries(); //cleanup before fetching more data |
137 |
|
|
138 |
|
if (listType == ListType.ListSearch) { |
139 |
|
enableNamesearchField(); |
140 |
|
} |
141 |
|
|
142 |
if (savedInstanceState == null) { |
if (savedInstanceState == null) { |
143 |
|
|
|
|
|
144 |
switch (listType) { |
switch (listType) { |
145 |
case ListNearest: |
case ListNearest: |
146 |
startNearestLookup(); |
startNearestLookup(); |
147 |
break; |
break; |
148 |
case ListSearch: |
case ListSearch: |
149 |
enableNamesearchField(); |
// do nothing here |
150 |
break; |
break; |
151 |
case ListFavorites: |
case ListFavorites: |
152 |
startFavoriteLookup(); |
startFavoriteLookup(); |
156 |
} |
} |
157 |
|
|
158 |
} else { |
} else { |
159 |
|
((TextView)findViewById(R.id.stationsearch)).setText( savedInstanceState.getString( "search") ); |
160 |
|
|
161 |
stations = (StationBean) savedInstanceState.getSerializable("stations"); |
stations = (StationBean) savedInstanceState.getSerializable("stations"); |
162 |
adapter.setStations(stations); |
adapter.setStations(stations); |
163 |
} |
} |
240 |
if (dialog != null && dialog.isShowing()) |
if (dialog != null && dialog.isShowing()) |
241 |
dialog.dismiss(); |
dialog.dismiss(); |
242 |
outState.putSerializable("stations", (StationBean) stations); |
outState.putSerializable("stations", (StationBean) stations); |
243 |
|
outState.putString("search", ((TextView)findViewById(R.id.stationsearch)).getText().toString() ); |
244 |
|
|
245 |
} |
} |
246 |
|
|