当前位置:网站首页>How to destroy a fragment- How to destroy Fragment?

How to destroy a fragment- How to destroy Fragment?

2022-06-13 02:30:00 Bustling city

problem :

I have one Activity . I have one Activity .The Activity has two Fragment s.Activity There are two Fragment .Fragment A is Menu. fragment A It's the menu .Fragment B is Detail. fragment B It's details .

I try to Make other Fragment C in Fragment B, so, There are 3 Fragment in the Activity . I tried in the clip B Make other clips in C, therefore , Activity Yes 3 A fragment .And I try to Replace Fragment B to Fragment D. I try to put the fragment B Replace with a fragment D.

I guess Fragment B and C is dead. I guess the clip B and C It's dead .BUT these Fragments is alive. But these clips are still alive .Just Fragments are onDestroyView() state. It's just Fragments be in onDestroyView() state .I want onDestroy() or onDetach() . I want onDestroy() or onDetach() .

What do I do for Fragments.onDestroy() or onDetach() ? What am I gonna do? Fragments.onDestroy() or onDetach()I can't destroy or change the Activity . I cannot destroy or change Activity .


Solution :

Reference resources : https://stackoom.com/en/question/Ts1r
原网站

版权声明
本文为[Bustling city ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280542506222.html