diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index 87ade48c39..46492fd3ee 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -133,7 +133,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadIn } } } - items.add(new StartEditingTravelCard(app, nightMode)); + items.add(new StartEditingTravelCard(app, getMyActivity(), nightMode)); adapter.setItems(items); final DownloadIndexesThread downloadThread = app.getDownloadThread(); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java index 7b57c7a51a..43ddf6e042 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java @@ -1,5 +1,7 @@ package net.osmand.plus.wikivoyage.explore.travelcards; +import android.app.Activity; +import android.content.Context; import android.net.Uri; import android.support.annotation.NonNull; import android.support.customtabs.CustomTabsIntent; @@ -16,8 +18,11 @@ public class StartEditingTravelCard extends BaseTravelCard { public static final int TYPE = 1; - public StartEditingTravelCard(OsmandApplication app, boolean nightMode) { + private Context context; + + public StartEditingTravelCard(OsmandApplication app, Activity context, boolean nightMode) { super(app, nightMode); + this.context = context; } @Override @@ -35,7 +40,7 @@ public class StartEditingTravelCard extends BaseTravelCard { .setToolbarColor(ContextCompat.getColor(app, nightMode ? R.color.actionbar_dark_color : R.color.actionbar_light_color)) .build(); String text = "https://" + app.getLanguage().toLowerCase() + ".m.wikivoyage.org"; - customTabsIntent.launchUrl(app, Uri.parse(text)); + customTabsIntent.launchUrl(context, Uri.parse(text)); } }); }