From 750607da3c2baabfbb7c05b2fd887596084de756 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sun, 15 Apr 2018 18:39:06 +0300 Subject: [PATCH] Fix fragmentManager for WikivoyageShowPicturesDialogFragment --- .../article/WikivoyageArticleDialogFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 30e700ee7f..97731176eb 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -21,16 +21,16 @@ import android.view.ViewGroup; import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.TextView; + import net.osmand.AndroidUtils; import net.osmand.IndexConstants; import net.osmand.plus.GPXUtilities; +import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings.WikivoyageShowImages; import net.osmand.plus.R; -import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.activities.TrackActivity; -import net.osmand.plus.myplaces.TrackPointFragment; import net.osmand.plus.wikivoyage.WikivoyageBaseDialogFragment; import net.osmand.plus.wikivoyage.WikivoyageShowPicturesDialogFragment; import net.osmand.plus.wikivoyage.WikivoyageWebViewClient; @@ -230,10 +230,11 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen OsmandSettings settings = getMyApplication().getSettings(); if (!settings.WIKIVOYAGE_SHOW_IMAGES_ASKED.get()) { FragmentActivity activity = getActivity(); - if (activity != null) { + FragmentManager fm = getFragmentManager(); + if (activity != null && fm != null) { WikivoyageShowPicturesDialogFragment fragment = new WikivoyageShowPicturesDialogFragment(); fragment.setTargetFragment(this, WikivoyageShowPicturesDialogFragment.SHOW_PICTURES_CHANGED); - fragment.show(activity.getSupportFragmentManager(), WikivoyageShowPicturesDialogFragment.TAG); + fragment.show(fm, WikivoyageShowPicturesDialogFragment.TAG); settings.WIKIVOYAGE_SHOW_IMAGES_ASKED.set(true); } }