遇到一个 fragment 泄漏的问题
使用 leak canary 发现了一个fragment的内存泄漏一直找不到原因 ,各位帮看看,引用栈:
In com.vanke.activity:1.0:1.
* com.vanke.activity.act.home.MainFragment has leaked:
* GC ROOT static android.view.inputmethod.InputMethodManager.sInstance
* references android.view.inputmethod.InputMethodManager.mCurRootView
* references com.android.internal.policy.impl.PhoneWindow$DecorView.mContext
* references com.vanke.activity.act.home.MainActivity.mFragmentManager
* references android.app.FragmentManagerImpl.mActive
* references java.util.ArrayList.array
* references array java.lang.Object[].[0]
* leaks com.vanke.activity.act.home.MainFragment instance
* Reference Key: 4df07d87-564f-4530-8e77-bbcf7b13f717
* Device: HUAWEI Huawei H60-L11 H60-L11
* Android Version: 4.4.2 API: 19
* Durations: watch=5244ms, gc=133ms, heap dump=459ms, analysis=8643ms
In com.vanke.activity:1.0:1.
* com.vanke.activity.act.home.MainFragment has leaked:
* GC ROOT static android.view.inputmethod.InputMethodManager.sInstance
* references android.view.inputmethod.InputMethodManager.mCurRootView
* references com.android.internal.policy.impl.PhoneWindow$DecorView.mContext
* references com.vanke.activity.act.home.MainActivity.mFragmentManager
* references android.app.FragmentManagerImpl.mActive
* references java.util.ArrayList.array
* references array java.lang.Object[].[0]
* leaks com.vanke.activity.act.home.MainFragment instance
* Reference Key: 4df07d87-564f-4530-8e77-bbcf7b13f717
* Device: HUAWEI Huawei H60-L11 H60-L11
* Android Version: 4.4.2 API: 19
* Durations: watch=5244ms, gc=133ms, heap dump=459ms, analysis=8643ms
...全文
相关推荐
FragmentPagerAdapter刷新fragment最完美解决方案
FragmentPagerAdapter刷新fragment最完美解决方案源代码
Android-Memory-Leaks:这是一个示例,说明Android中的片段如何发生内存泄漏。 它也有解决问题的方法
Android内存泄漏 这是一个示例,说明Android中的片段如何发生内存泄漏。 它也有解决该问题的方法。 有关此问题的深入说明,请参见本文
Fragment与Activity使用Handler进行交互
这里简单介绍了Fragment和Activity使用Handler方式进行交互。
ViewPager+Fragment懒加载问题
Android中ViewPager+Fragment懒加载问题解决方案Android中ViewPager+Fragment取消(禁止)预加载延迟加载(懒加载)问题解决方案
Fragment多个的切换重叠问题解决
对多个Fragment的切换导致页面重叠的问题进行解决,经过验证可以使用。


