AsyncTask内存泄漏的问题及处理办法

This field leaks a context object less... (Ctrl+F1) 
A static field will leak contexts.  Non-static inner classes have an implicit reference to their outer class. If that outer class is for example a Fragment or Activity, then this reference means that the long-running handler/loader/task will hold a reference to the activity which prevents it from getting garbage collected.  Similarly, direct field references to activities and fragments from these longer running instances can cause leaks.  ViewModel classes should never point to Views or non-application Contexts.

 https://blog.csdn.net/mo_feng_/article/details/82740460

 

 

展开阅读全文

没有更多推荐了,返回首页