isAdd 直接推出
This commit is contained in:
@@ -211,7 +211,7 @@ class M1ContainFragment :
|
||||
mShownByMe.isAccessible = true
|
||||
mDismissed.setBoolean(this, false)
|
||||
mShownByMe.setBoolean(this, true)
|
||||
if (isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
if (isAdded) {
|
||||
return
|
||||
}
|
||||
val ft: FragmentTransaction = manager.beginTransaction()
|
||||
@@ -300,10 +300,8 @@ class M1ContainFragment :
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
if (bpFunctionGroup.isAdded) {
|
||||
//解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(bpFunctionGroup)
|
||||
.commitNowAllowingStateLoss()
|
||||
CallerLogger.d(M_BUS_P + DebugViewWatchDogFragment.TAG, "已经添加正在移除")
|
||||
CallerLogger.d(M_BUS_P + DebugViewWatchDogFragment.TAG, "已经添加")
|
||||
return
|
||||
}
|
||||
bpFunctionGroup.show(parentFragmentManager, TAG)
|
||||
CallerLogger.d(M_BUS_P + TAG, "展示$tab---$bpFunctionGroup")
|
||||
|
||||
Reference in New Issue
Block a user