同一活动中的多个片段容器通过框架布局管理对所有容器以不同的方式管理 backpress

问题描述

在 1 个活动中,两个容器 X 和 Y, 在 X 帧中添加的片段 A, 单击片段 A 在帧 Y 中添加片段 C(exo 播放器视图), 单击片段 A 在帧 X 中添加片段 B, 现在 onbackpress 删除片段 B, 帧 Y 需要保持不变,但删除片段 C。

提前致谢

`supportFragmentManager.beginTransaction().replace(R.id.frameX,VideoDetailFragment()).commit()

supportFragmentManager.beginTransaction().replace(R.id.frameY,VideoFragment()).commit()

supportFragmentManager.beginTransaction().replace(R.id.frameX,DescriptionFragment()).commit()

活动中

覆盖乐趣 onBackpressed() { supportFragmentManager.popBackStack() //removes top fragment from both frame X and Y }`

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)