[Bus/TaxiDriver v2.5.1]OCH: fragment commit优化

This commit is contained in:
pangfan
2022-02-16 15:22:09 +08:00
parent 09bb4a5c33
commit c332a8cd77

View File

@@ -51,17 +51,17 @@ public class OchBusProvider implements IMogoOCH {
if (busFragment == null) {
Logger.d(TAG, "准备add fragment======");
busFragment = new OchBusFragment();
activity.getSupportFragmentManager().beginTransaction().add(containerId, busFragment).commit();
activity.getSupportFragmentManager().beginTransaction().add(containerId, busFragment).commitAllowingStateLoss();
return;
}
Logger.d(TAG, "准备show fragment");
activity.getSupportFragmentManager().beginTransaction().show(busFragment).commit();
activity.getSupportFragmentManager().beginTransaction().show(busFragment).commitAllowingStateLoss();
}
private void hideFragment() {
if (busFragment != null) {
Logger.d(TAG, "准备hide fragment");
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commit();
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commitAllowingStateLoss();
}
}