135 |
|
|
136 |
outState.putSerializable("departures", (ArrayList<DepartureBean>) departures); |
outState.putSerializable("departures", (ArrayList<DepartureBean>) departures); |
137 |
} |
} |
138 |
|
|
139 |
|
|
140 |
|
|
141 |
@Override |
@Override |
142 |
|
protected void onDestroy() { |
143 |
|
super.onDestroy(); |
144 |
|
|
145 |
|
if (fetcher != null) { |
146 |
|
fetcher.cancel(true); |
147 |
|
} |
148 |
|
} |
149 |
|
|
150 |
|
@Override |
151 |
protected void onListItemClick(ListView l, View v, int position, long id) { |
protected void onListItemClick(ListView l, View v, int position, long id) { |
152 |
super.onListItemClick(l, v, position, id); |
super.onListItemClick(l, v, position, id); |
153 |
|
|
231 |
pgDialog.dismiss(); |
pgDialog.dismiss(); |
232 |
|
|
233 |
if (success) { |
if (success) { |
234 |
|
DepartureList.this.getListView().setVisibility(View.GONE); //Experimental, inspired by http://osdir.com/ml/Android-Developers/2010-04/msg01198.html |
235 |
adapter.setDepartures(departures); |
adapter.setDepartures(departures); |
236 |
|
DepartureList.this.getListView().setVisibility(View.VISIBLE); |
237 |
|
|
238 |
if (departures.size() == 0) { |
if (departures.size() == 0) { |
239 |
MessageBox.showMessage(DepartureList.this, "No departures found"); |
MessageBox.showMessage(DepartureList.this, "No departures found", true); |
240 |
} |
} |
241 |
} else { // communication or parse error |
} else { // communication or parse error |
242 |
AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this); |
AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this); |
252 |
builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() { |
builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() { |
253 |
public void onClick(DialogInterface dialog, int id) { |
public void onClick(DialogInterface dialog, int id) { |
254 |
dialog.dismiss(); |
dialog.dismiss(); |
255 |
|
DepartureList.this.finish(); |
256 |
} |
} |
257 |
}); |
}); |
258 |
|
|