diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index e12d162e6e..0205feaaf6 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -254,18 +254,17 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme saveBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (article != null) { + getMyApplication().getTravelHelper().createGpxFile(article); + GPXFile gpxFile = article.getGpxFile(); if (saved) { - GPXFile gpxFile = article.getGpxFile(); getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); helper.removeArticleFromSaved(article); } else { - getMyApplication().getTravelHelper().createGpxFile(article); + getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, true, true); helper.addArticleToSaved(article); } updateSaveButton(); } - } }); } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java index e7b70ccb40..ef59c079a3 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java @@ -104,13 +104,14 @@ public class ArticleTravelCard extends BaseTravelCard { holder.rightButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + app.getTravelHelper().createGpxFile(article); + GPXFile gpxFile = article.getGpxFile(); if (saved) { - GPXFile gpxFile = article.getGpxFile(); app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); helper.removeArticleFromSaved(article); } else { + app.getSelectedGpxHelper().selectGpxFile(gpxFile, true, true); helper.addArticleToSaved(article); - app.getTravelHelper().createGpxFile(article); } updateSaveButton(holder); }