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

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

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

revision 579 by torben, Tue Feb 2 08:52:45 2010 UTC revision 652 by torben, Tue Apr 20 14:17:34 2010 UTC
# Line 18  import android.os.Bundle; Line 18  import android.os.Bundle;
18  import android.os.Handler;  import android.os.Handler;
19  import android.os.Message;  import android.os.Message;
20    
21    import android.util.Log;
22  import android.view.ContextMenu;  import android.view.ContextMenu;
23  import android.view.LayoutInflater;  import android.view.LayoutInflater;
24  import android.view.Menu;  import android.view.Menu;
# Line 495  public class StationList extends ListAct Line 496  public class StationList extends ListAct
496                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
497                                                  dialog.dismiss();                                                  dialog.dismiss();
498                                                                                                    
499                                                  stationsFetched.post( new Runnable() {                                                  Runnable runner = null;
500                                                          @Override                                                  switch (method) {
501                                                          public void run() {                                                  case ByLocation:
502                                                                  startLocatorTask();                                                                                                                      runner = new Runnable() {
503                                                          }                                                                  @Override
504                                                  });                                                                  public void run() {
505                                                                            startLocatorTask();                                                            
506                                                                    }
507                                                            };
508                                                            break;
509                                                    case ByName:
510                                                            runner = new Runnable() {
511                                                                    @Override
512                                                                    public void run() {
513                                                                            startNameSearch( FindStationsTask.this.name );
514                                                                    }
515                                                            };
516                                                            break;
517                                                    case ByList:
518                                                            runner = new Runnable() {
519                                                                    @Override
520                                                                    public void run() {
521                                                                            startFavoriteLookup();
522                                                                    }
523                                                            };
524                                                            break;
525                                                    }
526                                                    
527                                                    stationsFetched.post( runner );
528                                          }                                          }
529                                  });                                  });
530                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {
531                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
532                                                  dialog.dismiss();                                                  dialog.dismiss();
533                                          }                                                                                                }                                                      
534                                  });                                                                                                                              });                    
535                                  builder.show();                                                          try {
536                                            builder.show();
537                                    } catch (android.view.WindowManager.BadTokenException e) {                                      
538                                            Log.i("StationList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running
539                                    }
540                          }                          }
541                  }                  }
542          }          }

Legend:
Removed from v.579  
changed lines
  Added in v.652

  ViewVC Help
Powered by ViewVC 1.1.20