--- android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java 2011/04/04 22:14:40 1261 +++ 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 @@ -453,7 +454,8 @@ } if (departures.entries.size() == 0) { - MessageBox.showMessage(DepartureList.this, "No departures found", true); + int msgId = (arrival==false) ? R.string.departurelist_nodepartures : R.string.departurelist_noarrivals; + MessageBox.showMessage(DepartureList.this, getString(msgId), false); } } else { // communication or parse error commFailCounter++; @@ -476,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 @@ -582,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