--- android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java 2011/04/05 05:31:32 1262 +++ android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java 2011/04/05 07:54:45 1264 @@ -429,7 +429,8 @@ pgDialog.dismiss(); - + //TODO: differentiate whether it was a communication error with my backend + //or that the backend failed because bane.dk was unavailable if (departures != null) { commFailCounter = 0; DepartureList.this.getListView().setVisibility(View.GONE); //Experimental, inspired by http://osdir.com/ml/Android-Developers/2010-04/msg01198.html @@ -452,7 +453,7 @@ }); } - if (departures.entries.size() != 0) { + if (departures.entries.size() == 0) { int msgId = (arrival==false) ? R.string.departurelist_nodepartures : R.string.departurelist_noarrivals; MessageBox.showMessage(DepartureList.this, getString(msgId), false); } @@ -477,7 +478,7 @@ } }); - try { + try { //TODO: is this still necessary after the 0.9.4.1 fix ? builder.show(); } catch (android.view.WindowManager.BadTokenException e) { Log.i("DepartureList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running @@ -583,11 +584,11 @@ builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); - DepartureList.this.finish(); + DepartureList.this.finish(); //TODO: should we really close the activity ?? } }); - try { + try { //TODO: is this still necessary after the 0.9.4.1 fix ? builder.show(); } catch (android.view.WindowManager.BadTokenException e) { Log.i("DepartureList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running