防止重复添加

This commit is contained in:
yangyakun
2022-12-07 16:48:46 +08:00
parent c78509d484
commit 44d876ab08

View File

@@ -60,7 +60,9 @@ public class BusProvider implements IMogoOCH {
} else {
busFragment = new BusFragment();
}
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
if(!busFragment.isAdded()) {
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
}
return;
}
CallerLogger.INSTANCE.d(TAG, "准备show fragment");