From 9f0bda924d97c337b39bcbd2f598034fb5a59543 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 1 Mar 2021 14:57:58 +0200 Subject: [PATCH] Fix possible IllegalStateException --- OsmAnd/src/net/osmand/plus/OsmandPlugin.java | 2 +- OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java index 90342ff256..9775fdd415 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java @@ -468,7 +468,7 @@ public abstract class OsmandPlugin { FragmentManager fm = mapActivity.getSupportFragmentManager(); Fragment fragment = fm.findFragmentByTag(fragmentData.tag); if (fragment != null) { - fm.beginTransaction().remove(fragment).commit(); + fm.beginTransaction().remove(fragment).commitAllowingStateLoss(); } } } diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 4afb671275..fc4bb84f0e 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -1004,7 +1004,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo new TransactionBuilder(mapActivity.getSupportFragmentManager(), settings, mapActivity); builder.addFragmentsData(fragmentsData) .addFragmentsData(OsmandPlugin.getPluginsCardsList()) - .getFragmentTransaction().commit(); + .getFragmentTransaction().commitAllowingStateLoss(); } private void removeFragment(String tag) {