Fix exception

This commit is contained in:
Victor Shcherb 2012-09-15 17:12:00 +02:00
parent bd29fe7171
commit 8a5ae6accf
3 changed files with 17 additions and 8 deletions

View file

@ -615,7 +615,10 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
public void onClick(View v) {
if (ch.isChecked()) {
groupsToDelete.add(model);
favoritesToDelete.addAll(helper.getFavoriteGroups().get(model));
List<FavouritePoint> fvs = helper.getFavoriteGroups().get(model);
if (fvs != null) {
favoritesToDelete.addAll(fvs);
}
favouritesAdapter.notifyDataSetInvalidated();
} else {
groupsToDelete.remove(model);

View file

@ -352,15 +352,16 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
restoreRoutingMode();
quit = true;
restoreRoutingModeInner();
}
});
builder.setNegativeButton(R.string.default_buttons_no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
notRestoreRoutingMode();
quit = true;
notRestoreRoutingMode();
}
});
final AlertDialog dlg = builder.show();
@ -383,8 +384,11 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
delay --;
tv.setText(getString(R.string.continue_follow_previous_route_auto, delay + ""));
if(delay <= 0) {
if(dlg.isShowing()) {
dlg.dismiss();
restoreRoutingMode();
}
quit = true;
restoreRoutingModeInner();
} else {
uiHandler.postDelayed(delayDisplay, 1000);
}
@ -394,8 +398,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
delayDisplay.run();
}
private void restoreRoutingMode() {
quit = true;
private void restoreRoutingModeInner() {
AsyncTask<String, Void, GPXFile> task = new AsyncTask<String, Void, GPXFile>() {
@Override
protected GPXFile doInBackground(String... params) {

View file

@ -45,6 +45,9 @@ public class OsmEditingPlugin extends OsmandPlugin {
@Override
public void updateLayers(OsmandMapTileView mapView, MapActivity activity){
if (osmBugsLayer == null) {
registerLayers(activity);
}
if(mapView.getLayers().contains(osmBugsLayer) != settings.SHOW_OSM_BUGS.get()){
if(settings.SHOW_OSM_BUGS.get()){
mapView.addLayer(osmBugsLayer, 2);