/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1372 by torben, Tue Apr 5 07:54:45 2011 UTC revision 1373 by torben, Sat Apr 23 08:01:57 2011 UTC
# Line 431  public class DepartureList extends ListA Line 431  public class DepartureList extends ListA
431                          pgDialog.dismiss();                          pgDialog.dismiss();
432                          //TODO: differentiate whether it was a communication error with my backend                          //TODO: differentiate whether it was a communication error with my backend
433                          //or that the backend failed because bane.dk was unavailable                          //or that the backend failed because bane.dk was unavailable
434                          if (departures != null) {                          if (departures != null && departures.errorCode == null) {
435                                  commFailCounter = 0;                                  commFailCounter = 0;
436                                  DepartureList.this.getListView().setVisibility(View.GONE); //Experimental, inspired by http://osdir.com/ml/Android-Developers/2010-04/msg01198.html                                  DepartureList.this.getListView().setVisibility(View.GONE); //Experimental, inspired by http://osdir.com/ml/Android-Developers/2010-04/msg01198.html
437                                  adapter.setDepartures(departures.entries);                                  adapter.setDepartures(departures.entries);
# Line 459  public class DepartureList extends ListA Line 459  public class DepartureList extends ListA
459                                  }                                  }
460                          } else { // communication or parse error                          } else { // communication or parse error
461                                  commFailCounter++;                                  commFailCounter++;
462                                  AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this);                                                                                AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this);
463                                  builder.setMessage("Error finding departures");                                  
464                                    if (departures != null && departures.errorCode != null ) { //got an error xml back
465                                            commFailCounter = 10;
466                                            builder.setMessage( getString(R.string.no_backend) );
467                                    } else {                                        
468                                            builder.setMessage( getString(R.string.departurelist_fetcherror) );            
469                                    }
470                                  builder.setCancelable(true);                                  builder.setCancelable(true);
471                                    
472                                  if (commFailCounter < 3) {                                  if (commFailCounter < 3) {
473                                          builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() {                                          builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() {
474                                                  public void onClick(DialogInterface dialog, int id) {                                                  public void onClick(DialogInterface dialog, int id) {

Legend:
Removed from v.1372  
changed lines
  Added in v.1373

  ViewVC Help
Powered by ViewVC 1.1.20