/[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 1007 by torben, Tue Aug 3 06:12:10 2010 UTC revision 1423 by torben, Mon May 2 17:14:29 2011 UTC
# Line 1  Line 1 
1  package dk.thoerup.traininfo;  package dk.thoerup.traininfo;
2    
 import static dk.thoerup.traininfo.R.string.departurelist_fetchdepartures;  
3  import static dk.thoerup.traininfo.R.string.departurelist_fetcharrivals;  import static dk.thoerup.traininfo.R.string.departurelist_fetcharrivals;
4    import static dk.thoerup.traininfo.R.string.departurelist_fetchdepartures;
5  import static dk.thoerup.traininfo.R.string.generic_cancel;  import static dk.thoerup.traininfo.R.string.generic_cancel;
6  import static dk.thoerup.traininfo.R.string.generic_retry;  import static dk.thoerup.traininfo.R.string.generic_retry;
7    
   
8  import java.text.NumberFormat;  import java.text.NumberFormat;
9    
   
10  import android.app.AlertDialog;  import android.app.AlertDialog;
11  import android.app.Dialog;  import android.app.Dialog;
12  import android.app.ListActivity;  import android.app.ListActivity;
13  import android.app.ProgressDialog;  import android.app.ProgressDialog;
14  import android.content.DialogInterface;  import android.content.DialogInterface;
15  import android.content.Intent;  import android.content.Intent;
16    import android.graphics.Typeface;
17  import android.net.Uri;  import android.net.Uri;
18  import android.os.AsyncTask;  import android.os.AsyncTask;
19  import android.os.Bundle;  import android.os.Bundle;
# Line 25  import android.view.View; Line 24  import android.view.View;
24  import android.view.View.OnClickListener;  import android.view.View.OnClickListener;
25  import android.widget.Button;  import android.widget.Button;
26  import android.widget.ListView;  import android.widget.ListView;
27    import android.widget.TableLayout;
28    import android.widget.TableRow;
29  import android.widget.TextView;  import android.widget.TextView;
30    import dk.thoerup.android.traininfo.common.DepartureBean;
31    import dk.thoerup.android.traininfo.common.DepartureEntry;
32    import dk.thoerup.android.traininfo.common.MetroBean;
33    import dk.thoerup.android.traininfo.common.MetroBean.MetroEntry;
34    import dk.thoerup.android.traininfo.common.StationEntry;
35  import dk.thoerup.traininfo.provider.DepartureProvider;  import dk.thoerup.traininfo.provider.DepartureProvider;
36    import dk.thoerup.traininfo.provider.MetroProvider;
37  import dk.thoerup.traininfo.provider.ProviderFactory;  import dk.thoerup.traininfo.provider.ProviderFactory;
38  import dk.thoerup.traininfo.util.MessageBox;  import dk.thoerup.traininfo.util.MessageBox;
39    
# Line 35  public class DepartureList extends ListA Line 42  public class DepartureList extends ListA
42          public static final int DLG_PROGRESS = 1;          public static final int DLG_PROGRESS = 1;
43          static final int MENU_MAP = 100;          static final int MENU_MAP = 100;
44          static final int MENU_NOTIFICATIONS = 101;          static final int MENU_NOTIFICATIONS = 101;
45            static final int MENU_METROMAP= 102;
46                    
47                    
48          DepartureListAdapter adapter;          DepartureListAdapter adapter;
49          DepartureProvider provider;          DepartureProvider provider;
50          DepartureBean departures;          DepartureBean departures;
51                    
52            MetroBean metroBean;
53            MetroProvider metro;
54            
55          int selectedItemId;          int selectedItemId;
56          //DepartureBean currentDeparture;          //DepartureBean currentDeparture;
57                    
58          ProgressDialog pgDialog;          ProgressDialog pgDialog;
59                    
60          DepartureFetcher fetcher;          DepartureFetcher fetcher;
61            MetroFetcher metroFetcher;
62    
63          StationBean station;          StationEntry station;
64                    
65          boolean arrival = false;          String trainType = "REGIONAL";
66                    
67            boolean arrival = false;
68    
69            int commFailCounter = 0;
70    
71          @Override          @Override
72          protected void onCreate(Bundle savedInstanceState) {          protected void onCreate(Bundle savedInstanceState) {
# Line 63  public class DepartureList extends ListA Line 78  public class DepartureList extends ListA
78                                    
79                  Intent launchedBy = getIntent();                  Intent launchedBy = getIntent();
80                    
81                  station = (StationBean) launchedBy.getSerializableExtra("stationbean");                  station = (StationEntry) launchedBy.getSerializableExtra("stationbean");
82                                    
83                  ((TextView) findViewById(R.id.stationName)).setText( station.getName() );                  ((TextView) findViewById(R.id.stationName)).setText( station.getName() );
84    
# Line 72  public class DepartureList extends ListA Line 87  public class DepartureList extends ListA
87                                    
88                  final Button departureBtn = (Button) findViewById(R.id.departurebtn);                  final Button departureBtn = (Button) findViewById(R.id.departurebtn);
89                  final Button arrivalBtn = (Button) findViewById(R.id.arrivalbtn);                  final Button arrivalBtn = (Button) findViewById(R.id.arrivalbtn);
90                    final Button metroBtn = (Button) findViewById(R.id.metrobtn);
91                    final Button regionalBtn = (Button) findViewById(R.id.regionalbtn);
92                    final Button stogBtn = (Button) findViewById(R.id.stogbtn);
93                    
94                    final View metroView = findViewById(R.id.metroonly);
95                                    
96                  departureBtn.setOnClickListener( new OnClickListener() {                  departureBtn.setOnClickListener( new OnClickListener() {
97                          @Override                          @Override
98                          public void onClick(View arg0) {                                  public void onClick(View arg0) {        
99                                  arrivalBtn.setBackgroundResource(R.drawable.custom_button);                                  arrivalBtn.setBackgroundResource(R.drawable.custom_button);
100                                  departureBtn.setBackgroundResource(R.drawable.custom_button_hilight);                                  departureBtn.setBackgroundResource(R.drawable.custom_button_hilight);
101                                    metroBtn.setBackgroundResource(R.drawable.custom_button);
102                                    
103                                    getListView().setVisibility( View.VISIBLE );            
104                                    metroView.setVisibility( View.GONE );
105                                  arrival = false;                                  arrival = false;
106                                  startDepartureFetcher();                                  startDepartureFetcher();
107                          }                          }
# Line 87  public class DepartureList extends ListA Line 111  public class DepartureList extends ListA
111                          public void onClick(View arg0) {                                  public void onClick(View arg0) {        
112                                  arrivalBtn.setBackgroundResource(R.drawable.custom_button_hilight);                                  arrivalBtn.setBackgroundResource(R.drawable.custom_button_hilight);
113                                  departureBtn.setBackgroundResource(R.drawable.custom_button);                                  departureBtn.setBackgroundResource(R.drawable.custom_button);
114                                    metroBtn.setBackgroundResource(R.drawable.custom_button);
115                                    
116                                    getListView().setVisibility( View.VISIBLE );            
117                                    metroView.setVisibility( View.GONE );
118                                  arrival = true;                                                  arrival = true;                
119                                  startDepartureFetcher();                                  startDepartureFetcher();
120                          }                          }
121                  });                  });
122                                    
123                    regionalBtn.setOnClickListener( new OnClickListener() {
124                            @Override
125                            public void onClick(View arg0) {        
126                                    regionalBtn.setBackgroundResource(R.drawable.custom_button_hilight);
127                                    stogBtn.setBackgroundResource(R.drawable.custom_button);                                
128                                    metroBtn.setBackgroundResource(R.drawable.custom_button);
129                                    
130                                    departureBtn.setVisibility( View.VISIBLE );
131                                    arrivalBtn.setVisibility( View.VISIBLE );
132                                    
133                                    getListView().setVisibility( View.VISIBLE );            
134                                    metroView.setVisibility( View.GONE );
135                                    trainType = "REGIONAL";
136                                    startDepartureFetcher();
137                            }
138                    });
139                    stogBtn.setOnClickListener( new OnClickListener() {
140                            @Override
141                            public void onClick(View arg0) {        
142                                    regionalBtn.setBackgroundResource(R.drawable.custom_button);
143                                    stogBtn.setBackgroundResource(R.drawable.custom_button_hilight);                                
144                                    metroBtn.setBackgroundResource(R.drawable.custom_button);
145    
146    
147                                    departureBtn.setVisibility( View.VISIBLE );
148                                    arrivalBtn.setVisibility( View.VISIBLE );
149                                    
150                                    getListView().setVisibility( View.VISIBLE );            
151                                    metroView.setVisibility( View.GONE );
152                                    trainType = "STOG";                    
153                                    startDepartureFetcher();
154                            }
155                    });
156    
157                    
158                    
159                    metroBtn.setOnClickListener( new OnClickListener() {                    
160                            @Override
161                            public void onClick(View v) {
162                                    regionalBtn.setBackgroundResource(R.drawable.custom_button);
163                                    stogBtn.setBackgroundResource(R.drawable.custom_button);                                
164                                    metroBtn.setBackgroundResource(R.drawable.custom_button_hilight);
165                                    
166                                    departureBtn.setVisibility( View.GONE );
167                                    arrivalBtn.setVisibility( View.GONE );
168                                    
169                                    getListView().setVisibility( View.GONE );              
170                                    metroView.setVisibility( View.VISIBLE );
171                                    startMetroFetcher();
172                            }
173                    });
174                    
175                                    
176                                    
177                                    
178                  // findViewById(R.id.header).setOnClickListener( mapLauncher );                  // findViewById(R.id.header).setOnClickListener( mapLauncher );
179                                    
180                  int distance = station.getDistance();                  int distance = station.getCalcdist();
181                  if (distance != 0) {                  if (distance != 0) {
182                          NumberFormat format = NumberFormat.getNumberInstance();                          NumberFormat format = NumberFormat.getNumberInstance();
183                          format.setMaximumFractionDigits(1);                          format.setMaximumFractionDigits(1);
# Line 107  public class DepartureList extends ListA Line 187  public class DepartureList extends ListA
187                  } else {                  } else {
188                          ((TextView) findViewById(R.id.stationDistance)).setVisibility(View.GONE);                          ((TextView) findViewById(R.id.stationDistance)).setVisibility(View.GONE);
189                  }                  }
190            
191                    ProviderFactory.purgeOldEntries(); //cleanup before fetching more data
192                                    
193                    Log.e("Station", station.toCSV() );
194                    
195                    if (station.isMetro() == false) {
196                            metroBtn.setVisibility( View.GONE );
197                    }
198                    
199                  if (station.isRegional() == false && station.isSTrain() == false) {                  metro = ProviderFactory.getMetroProvider();
200                    
201                    if (station.isRegional() == false ) {
202                            regionalBtn.setVisibility(View.GONE);
203                    }
204                    
205                    if (station.isStrain() == false ) {
206                            stogBtn.setVisibility(View.GONE);
207                    }
208                    
209                    if (station.isRegional() == true && station.isStrain() == false ) {
210                            if ( station.isMetro() == false )
211                                    regionalBtn.setVisibility(View.GONE);
212                            trainType = "REGIONAL";                
213                    }              
214    
215                    if (station.isRegional() == false  && station.isStrain() == true) {
216                            if (station.isMetro() == false)
217                                    stogBtn.setVisibility(View.GONE);
218    
219                            stogBtn.setBackgroundResource(R.drawable.custom_button_hilight);
220                            trainType = "STOG";
221                            
222                    }
223                                    
224                    
225                    if (station.isRegional() == false && station.isStrain() == false) {
226                          getListView().setVisibility( View.GONE );                                        getListView().setVisibility( View.GONE );              
227                          findViewById(R.id.metroonly).setVisibility( View.VISIBLE );                          metroView.setVisibility( View.VISIBLE );
228                            
229                          departureBtn.setVisibility( View.GONE );                          departureBtn.setVisibility( View.GONE );
230                          arrivalBtn.setVisibility(View.GONE);                          arrivalBtn.setVisibility(View.GONE);
231                            metroBtn.setVisibility( View.GONE );            
232                            
233                            
234                            
235                            if (savedInstanceState == null) {
236                                    startMetroFetcher();
237                            } else {
238                                    metroBean = (MetroBean) savedInstanceState.getSerializable("metro");
239                                    loadMetroData();
240                            }
241                                                    
242                  } else {                  } else {
243                          provider = ProviderFactory.getDepartureProvider();                          provider = ProviderFactory.getDepartureProvider();
# Line 149  public class DepartureList extends ListA Line 273  public class DepartureList extends ListA
273          outState.putInt("selectedItemId", selectedItemId);          outState.putInt("selectedItemId", selectedItemId);
274                    
275          outState.putSerializable("departures",  departures);          outState.putSerializable("departures",  departures);
276            outState.putSerializable("metro", metroBean);
277      }      }
278            
279            
# Line 160  public class DepartureList extends ListA Line 285  public class DepartureList extends ListA
285                  if (fetcher != null) {                  if (fetcher != null) {
286                          fetcher.cancel(true);                          fetcher.cancel(true);
287                  }                  }
288                    
289                    if (metroFetcher != null) {
290                            metroFetcher.cancel(true);
291                    }
292          }          }
293    
294          @Override          @Override
# Line 216  public class DepartureList extends ListA Line 345  public class DepartureList extends ListA
345                  item.setIcon(android.R.drawable.ic_menu_mapmode);                  item.setIcon(android.R.drawable.ic_menu_mapmode);
346                                    
347                  item = menu.add(0, MENU_NOTIFICATIONS, 0, getString(R.string.departurelist_notifications) );                  item = menu.add(0, MENU_NOTIFICATIONS, 0, getString(R.string.departurelist_notifications) );
348                  item.setIcon(android.R.drawable.ic_menu_info_details);                  item.setIcon(android.R.drawable.ic_menu_info_details);                  
                   
349                                    
350                  boolean notifEnabled = hasNotifications();                  boolean notifEnabled = hasNotifications();
351                  item.setEnabled(notifEnabled);                  item.setEnabled(notifEnabled);
352                                    
353                    if (station.isMetro()) {
354                            item = menu.add(0, MENU_METROMAP, 0, "Metro" ); //TODO:translate!?!
355                            item.setIcon(android.R.drawable.ic_menu_mapmode);                      
356                    }
357                    
358    
359                  return true;                  return true;
360          }          }
# Line 231  public class DepartureList extends ListA Line 364  public class DepartureList extends ListA
364                  boolean res;                  boolean res;
365                  switch(item.getItemId()) {                  switch(item.getItemId()) {
366                  case MENU_MAP:                  case MENU_MAP:
367                          Uri uri = Uri.parse("geo:" + station.getLatitude() + "," + station.getLongitude());                          Uri uri = Uri.parse("geo:" + station.getLatitude() + "," + station.getLongitude() + "?z=16");
368                          startActivity( new Intent(Intent.ACTION_VIEW, uri));                          startActivity( new Intent(Intent.ACTION_VIEW, uri));
369                          res = true;                          res = true;
370                          break;                          break;
# Line 241  public class DepartureList extends ListA Line 374  public class DepartureList extends ListA
374                          startActivity(i);                          startActivity(i);
375                          res = true;                          res = true;
376                          break;                          break;
377                    case MENU_METROMAP:
378                            Intent metroMap = new Intent(this,dk.thoerup.traininfo.MetroMap.class);
379                            startActivity(metroMap);
380                            res = true;
381                            break;                  
382                  default:                  default:
383                          res = super.onOptionsItemSelected(item);                          res = super.onOptionsItemSelected(item);
384                  }                  }
# Line 253  public class DepartureList extends ListA Line 391  public class DepartureList extends ListA
391                  fetcher.execute(station.getId());                  fetcher.execute(station.getId());
392          }          }
393                    
394            void startMetroFetcher() {
395                    showDialog(DLG_PROGRESS);
396                    metroFetcher = new MetroFetcher();
397                    metroFetcher.execute(station.getId());          
398            }
399            
400          class DialogDismisser implements View.OnClickListener {          class DialogDismisser implements View.OnClickListener {
401    
402                  Dialog dlg;                  Dialog dlg;
# Line 279  public class DepartureList extends ListA Line 423  public class DepartureList extends ListA
423                    
424          class DepartureFetcher extends AsyncTask<Integer, Void, Void> {          class DepartureFetcher extends AsyncTask<Integer, Void, Void> {
425    
   
426                  @Override                  @Override
427                  protected void onPostExecute(Void result) {                  protected void onPostExecute(Void result) {
428                          super.onPostExecute(result);                          super.onPostExecute(result);
429                                                    
430                                                    
431                          pgDialog.dismiss();                          pgDialog.dismiss();
432                            
433                          if (departures != null) {                          if (departures != null && departures.errorCode == null) {
434                                    commFailCounter = 0;
435                                  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
436                                  adapter.setDepartures(departures.entries);                                  adapter.setDepartures(departures.entries);
437                                  DepartureList.this.getListView().setVisibility(View.VISIBLE);                                  DepartureList.this.getListView().setVisibility(View.VISIBLE);
438                                                                    
439                                                                    
440                                    // handle notification icon.                                                            
441                                  if ( hasNotifications() ) {                                  if ( hasNotifications() ) {
442                                          findViewById(R.id.notifIcon).setVisibility(View.VISIBLE);                                          View notifIcon = findViewById(R.id.notifIcon);
443                                  }                                          notifIcon.setVisibility(View.VISIBLE);
444                                            notifIcon.setClickable(true);
445                                            notifIcon.setOnClickListener( new View.OnClickListener() {                                              
446                                                    @Override
447                                                    public void onClick(View v) {
448                                                            Intent i = new Intent(DepartureList.this, dk.thoerup.traininfo.NotificationList.class);
449                                                            i.putExtra(NotificationList.EXTRA_NOTIFICATIONS, departures.notifications);
450                                                            startActivity(i);                                                      
451                                                    }
452                                            });
453                                    }                              
454                                                                    
455                                  if (departures.entries.size() == 0) {                                  if (departures.entries.size() == 0) {
456                                          MessageBox.showMessage(DepartureList.this, "No departures found", true);                                          int msgId = (arrival==false) ? R.string.departurelist_nodepartures : R.string.departurelist_noarrivals;
457                                            MessageBox.showMessage(DepartureList.this, getString(msgId), false);
458                                  }                                  }
459                          } else { // communication or parse error                          } else { // communication or parse error
460                                  AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this);                                                                                commFailCounter++;
461                                  builder.setMessage("Error finding departures");                                  AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this);
462                                    
463                                    if (departures != null && departures.errorCode != null ) { //got an error xml back
464                                            commFailCounter = 10;
465                                            builder.setMessage( getString(R.string.no_backend) );
466                                    } else {                                        
467                                            builder.setMessage( getString(R.string.departurelist_fetcherror) );            
468                                    }
469                                  builder.setCancelable(true);                                  builder.setCancelable(true);
470                                  builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() {                                  
471                                    if (commFailCounter < 3) {
472                                            builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() {
473                                                    public void onClick(DialogInterface dialog, int id) {
474                                                            dialog.dismiss();
475                                                            startDepartureFetcher();
476                                                            
477                                                    }
478                                            });
479                                    }
480                                    builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {
481                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
482                                                  dialog.dismiss();                                                  dialog.dismiss();
483                                                  startDepartureFetcher();                                                  DepartureList.this.finish();
484                                                                                            }                                                      
                                         }  
485                                  });                                  });
486                                    
487                                    try { //TODO: is this still necessary after the 0.9.4.1 fix ?
488                                            builder.show();
489                                    } catch (android.view.WindowManager.BadTokenException e) {                                      
490                                            Log.i("DepartureList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running
491                                    }                              
492                            }
493                    }
494    
495                    @Override
496                    protected Void doInBackground(Integer... params) {
497                            departures = provider.lookupDepartures(params[0], DepartureList.this.arrival, trainType);
498                            return null;
499                    }
500                    
501            }
502            
503            public void loadMetroData() {
504                    ((TextView) findViewById(R.id.operations)).setText( metroBean.operationInfo );
505                    ((TextView) findViewById(R.id.plan)).setText( metroBean.plan );
506                    
507                    
508                    TableLayout table = (TableLayout) findViewById(R.id.metrotable);
509                    table.removeAllViews();
510                    
511                    TableRow head = new TableRow(this);
512                    
513                    TextView h1 = new TextView(this);
514                    h1.setText("Metro");
515                    h1.setTextSize(16);
516                    h1.setTypeface( Typeface.defaultFromStyle(Typeface.BOLD));
517                    
518                    
519                    TableRow.LayoutParams params = new TableRow.LayoutParams();
520                    params.span = 2;
521                    head.addView(h1, params);
522                    
523                    
524                    
525                    TextView h2 = new TextView(this);
526                    h2.setTextSize(16);
527                    h2.setTypeface( Typeface.defaultFromStyle(Typeface.BOLD));
528                    h2.setText("Om minutter");
529                    
530                    params = new TableRow.LayoutParams();
531                    params.weight = 2;
532                    head.addView(h2,params);
533    
534                    
535                    
536                    table.addView(head);
537    
538                    for (MetroEntry entry : metroBean.entries) {
539                            TableRow row = new TableRow(this);
540                            
541                            Log.e("Test", "" + entry.destination);
542                            
543                            TextView v1 = new TextView(this);
544                            v1.setTextSize(16);
545                            v1.setText( entry.metro );                      
546                            row.addView(v1);
547                            
548                            TextView v2 = new TextView(this);
549                            v2.setTextSize(16);
550                            v2.setText( entry.destination );
551                            row.addView(v2);
552                    
553                            TextView v3 = new TextView(this);
554                            v3.setTextSize(16);
555                            v3.setText( entry.minutes );
556                            row.addView(v3);
557                            
558                            table.addView(row);
559                            
560                    }
561                    findViewById(R.id.rootView).requestLayout();
562            }
563            
564            class MetroFetcher extends AsyncTask<Integer, Void, Void> {
565                    
566                    @Override
567                    protected void onPostExecute(Void result) {
568                            super.onPostExecute(result);
569                            
570                            
571                            
572                            pgDialog.dismiss();
573                            
574                            if (metroBean != null) {
575                                    loadMetroData();
576                            } else { // communication or parse error
577                                    commFailCounter++;
578                                    AlertDialog.Builder builder = new AlertDialog.Builder(DepartureList.this);                                              
579                                    builder.setMessage("Error finding metro data");
580                                    builder.setCancelable(true);
581                                    if (commFailCounter < 3) {
582                                            builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() {
583                                                    public void onClick(DialogInterface dialog, int id) {
584                                                            dialog.dismiss();
585                                                            startMetroFetcher();
586                                                            
587                                                    }
588                                            });
589                                    }
590                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {
591                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
592                                                  dialog.dismiss();                                                  dialog.dismiss();
593                                                  DepartureList.this.finish();                                                  DepartureList.this.finish(); //TODO: should we really close the activity ??
594                                          }                                                                                                }                                                      
595                                  });                                  });
596                                                                    
597                                  try {                                  try { //TODO: is this still necessary after the 0.9.4.1 fix ?
598                                          builder.show();                                          builder.show();
599                                  } catch (android.view.WindowManager.BadTokenException e) {                                                                        } catch (android.view.WindowManager.BadTokenException e) {                                      
600                                          Log.i("DepartureList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running                                          Log.i("DepartureList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running
# Line 327  public class DepartureList extends ListA Line 603  public class DepartureList extends ListA
603                  }                  }
604    
605                  @Override                  @Override
606                  protected Void doInBackground(Integer... params) {                  protected Void doInBackground(Integer... params) {                      
607                          departures = provider.lookupDepartures(params[0], DepartureList.this.arrival);                          metroBean = metro.lookupMetroInfo(params[0]);
608                          return null;                          return null;
609                  }                  }
610                                    
611          }          }
612    
613  }  }

Legend:
Removed from v.1007  
changed lines
  Added in v.1423

  ViewVC Help
Powered by ViewVC 1.1.20