Can not perform this action after onSaveInstanceState

com.mogo.module.small.map.SmallMapProvider.showPanel(SmallMapProvider.java:68)
This commit is contained in:
martindhy
2021-07-01 09:51:23 +08:00
parent 5afc524d49
commit 685862cb96

View File

@@ -69,11 +69,11 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang
if (mSmallMapFragment == null) {
Logger.d(TAG, "准备add fragment======");
mSmallMapFragment = new SmallMapFragment();
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mSmallMapFragment).commit();
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mSmallMapFragment).commitAllowingStateLoss();
return;
}
Logger.d(TAG, "准备show fragment");
mActivity.getSupportFragmentManager().beginTransaction().show(mSmallMapFragment).commit();
mActivity.getSupportFragmentManager().beginTransaction().show(mSmallMapFragment).commitAllowingStateLoss();
} catch (Exception e) {
e.printStackTrace();
}
@@ -85,7 +85,7 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang
try {
if (mSmallMapFragment != null) {
Logger.d(TAG, "准备hide fragment");
mActivity.getSupportFragmentManager().beginTransaction().hide(mSmallMapFragment).commit();
mActivity.getSupportFragmentManager().beginTransaction().hide(mSmallMapFragment).commitAllowingStateLoss();
}
} catch (Exception e) {
e.printStackTrace();