这听起来可能很基础,但在 onDetach
中,我为什么/应该清理什么?如果 fragment 正在被销毁,是否应该为我自动清理引用(例如 Context)?
最佳答案
shouldn't references, such as the Context, be automatically cleaned up for me?
是的。
in onDetach why/what should I be cleaning up?
没有。您可能在整个 Android 职业生涯中都没有充分的理由重写此方法。
关于android - 在 onDestroy 和 onDetach 中清除 fragment ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25611495/