我怎样才能删除所有片段时破坏活动 [英] How can I remove all fragment when activity destroy
本文介绍了我怎样才能删除所有片段时破坏活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你知道我怎么能清除所有的碎片在一个活动,在布局和backstack。
我知道,我们可以通过清除backstack:
FragmentManager.popBackStack(NULL,FragmentManager.POP_BACK_STACK_INCLUSIVE);
但是,我们在布局,我已动态添加到布局。
解决方案
我怎样可以删除所有片段,当活动破坏
块引用>在活动举行他们被摧毁所有碎片,自动销毁。
Do you know how can I clear all fragments in an activity, in layout and in backstack.
I know that we can clear backstack by using:
FragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
But what about in layout which I have dynamically added to layout.
解决方案How can I remove all fragment when activity destroy
All fragments are automatically destroyed when the activity holding them is destroyed.
这篇关于我怎样才能删除所有片段时破坏活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文