Fix possible IllegalStateException

This commit is contained in:
Vitaliy 2021-03-01 14:57:58 +02:00
parent 898d9224e0
commit 9f0bda924d
2 changed files with 2 additions and 2 deletions

View file

@ -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();
}
}
}

View file

@ -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) {