139 |
} |
} |
140 |
|
|
141 |
} |
} |
142 |
|
|
143 |
|
|
144 |
|
@Override |
145 |
|
protected void onDestroy() { |
146 |
|
super.onDestroy(); |
147 |
|
|
148 |
|
if (findStationsTask != null) { |
149 |
|
findStationsTask.cancel(true); |
150 |
|
} |
151 |
|
if (locationLookup != null) { |
152 |
|
locationLookup.stopSearch(); |
153 |
|
} |
154 |
|
isRunning = false; |
155 |
|
} |
156 |
|
|
157 |
|
|
158 |
protected void setTitle() { |
protected void setTitle() { |
159 |
String dialogTitle = getResources().getString(app_name); |
String dialogTitle = getResources().getString(app_name); |
160 |
switch (listType) { |
switch (listType) { |
274 |
message.append( getString(stationlist_nolocation) ); |
message.append( getString(stationlist_nolocation) ); |
275 |
} |
} |
276 |
|
|
277 |
MessageBox.showMessage(this, message.toString()); |
MessageBox.showMessage(this, message.toString(), false); |
278 |
break; |
break; |
279 |
default: |
default: |
280 |
retval = super.onOptionsItemSelected(item); |
retval = super.onOptionsItemSelected(item); |
453 |
|
|
454 |
case NOPROVIDER: |
case NOPROVIDER: |
455 |
dismissDialogSafe(DLG_PROGRESS); |
dismissDialogSafe(DLG_PROGRESS); |
456 |
MessageBox.showMessage(StationList.this, getString(stationlist_nolocationprovider) ); |
MessageBox.showMessage(StationList.this, getString(stationlist_nolocationprovider), true ); |
457 |
|
//StationList.this.finish(); |
458 |
break; |
break; |
459 |
case LOCATIONFIXTIMEOUT: |
case LOCATIONFIXTIMEOUT: |
460 |
if (isRunning) { |
if (isRunning) { |
555 |
showMessageAndClose(getString(stationlist_nostations)); |
showMessageAndClose(getString(stationlist_nostations)); |
556 |
} |
} |
557 |
stations = stationProvider.getStations(); |
stations = stationProvider.getStations(); |
558 |
|
|
559 |
|
StationList.this.getListView().invalidateViews(); |
560 |
adapter.setStations( stations ); |
adapter.setStations( stations ); |
561 |
|
|
562 |
|
|
563 |
} else { //communication or parse errors |
} else { //communication or parse errors |
564 |
AlertDialog.Builder builder = new AlertDialog.Builder(StationList.this); |
AlertDialog.Builder builder = new AlertDialog.Builder(StationList.this); |
565 |
builder.setMessage(getString(stationlist_nearbyerror)); |
builder.setMessage(getString(stationlist_fetcherror)); |
566 |
builder.setCancelable(true); |
builder.setCancelable(true); |
567 |
builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() { |
builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() { |
568 |
public void onClick(DialogInterface dialog, int id) { |
public void onClick(DialogInterface dialog, int id) { |
602 |
builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() { |
builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() { |
603 |
public void onClick(DialogInterface dialog, int id) { |
public void onClick(DialogInterface dialog, int id) { |
604 |
dialog.dismiss(); |
dialog.dismiss(); |
605 |
|
StationList.this.finish(); |
606 |
} |
} |
607 |
}); |
}); |
608 |
|
|