149 |
|
|
150 |
switch (listType) { |
switch (listType) { |
151 |
case ListNearest: |
case ListNearest: |
152 |
startLookup(); |
startNearestLookup(); |
153 |
break; |
break; |
154 |
case ListSearch: |
case ListSearch: |
155 |
showDialog(DLG_STATIONNAME); |
showDialog(DLG_STATIONNAME); |
324 |
dialog.dismiss(); |
dialog.dismiss(); |
325 |
String search = et.getText().toString().trim(); |
String search = et.getText().toString().trim(); |
326 |
if (search.length() >= 2) { |
if (search.length() >= 2) { |
327 |
startNameSearch(search); |
startNameLookup(search); |
328 |
} else { |
} else { |
329 |
showMessageAndClose( getString(stationlist_twocharmin) ); |
showMessageAndClose( getString(stationlist_twocharmin) ); |
330 |
} |
} |
380 |
///////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////// |
381 |
// |
// |
382 |
|
|
383 |
public void startLookup() { |
public void startNearestLookup() { |
384 |
dialogMessage = getString( stationlist_waitforlocation ); |
dialogMessage = getString( stationlist_waitforlocation ); |
385 |
showDialog(DLG_PROGRESS); |
showDialog(DLG_PROGRESS); |
386 |
|
|
388 |
stationsFetched.sendEmptyMessageDelayed(0, 500); |
stationsFetched.sendEmptyMessageDelayed(0, 500); |
389 |
} |
} |
390 |
|
|
391 |
void startNameSearch(String name) { |
void startNameLookup(String name) { |
392 |
dialogMessage = getString( stationlist_findbyname ); |
dialogMessage = getString( stationlist_findbyname ); |
393 |
showDialog(DLG_PROGRESS); |
showDialog(DLG_PROGRESS); |
394 |
|
|
466 |
builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() { |
builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() { |
467 |
public void onClick(DialogInterface dialog, int id) { |
public void onClick(DialogInterface dialog, int id) { |
468 |
dialog.dismiss(); |
dialog.dismiss(); |
469 |
startLookup(); |
startNearestLookup(); |
470 |
|
|
471 |
} |
} |
472 |
}); |
}); |
531 |
|
|
532 |
switch (method) { |
switch (method) { |
533 |
case ByLocation: |
case ByLocation: |
534 |
stations = stationProvider.lookupStations(loc); |
stations = stationProvider.lookupStationsByLocation(loc); |
535 |
break; |
break; |
536 |
case ByName: |
case ByName: |
537 |
stations = stationProvider.lookupStationsByName(name); |
stations = stationProvider.lookupStationsByName(name); |
584 |
runner = new Runnable() { |
runner = new Runnable() { |
585 |
@Override |
@Override |
586 |
public void run() { |
public void run() { |
587 |
startNameSearch( FindStationsTask.this.name ); |
startNameLookup( FindStationsTask.this.name ); |
588 |
} |
} |
589 |
}; |
}; |
590 |
break; |
break; |