Android Edittext正在使用leakcanary泄漏

Android Edittext正在使用leakcanary泄漏,android,android-studio,kotlin,memory-leaks,leakcanary,Android,Android Studio,Kotlin,Memory Leaks,Leakcanary,泄漏金丝雀的日志 漏痕= ┬ ├─ java.lang.Thread │ 泄漏:未知 │ 线程名称:“Studio:InputCon” │ gcroot:Java局部变量 │ ↓ 穿线。 │ ~~~~~~~~~~~~ ├─ com.android.tools.profiler.support.event.InputConnectionWrapper │ 泄漏:未知 │ ↓ InputConnectionWrapper.mT

泄漏金丝雀的日志 漏痕= ┬ ├─ java.lang.Thread │ 泄漏:未知 │ 线程名称:“Studio:InputCon” │ gcroot:Java局部变量 │ ↓ 穿线。 │ ~~~~~~~~~~~~ ├─ com.android.tools.profiler.support.event.InputConnectionWrapper │ 泄漏:未知 │ ↓ InputConnectionWrapper.mTarget │ ~~~~~~~ ├─ com.android.internal.widget.EditableInputConnection │ 泄漏:未知 │ ↓ EditableInputConnection.mTargetView │ ~~~~~~~~~~~ ├─ android.support.v7.widget.AppCompatiEditText │ 泄漏:是(View.mContext引用已销毁的活动) │ 的mContext实例 │ 视图#mParent已设置 │ 视图#mAttachInfo为空(视图已分离) │ View.mWindowAttachCount=1 │ ↓ AppCompatiEditText.mContext

如果您提供了代码片段,那会更好

  • 编辑文本不应该是静态的。Like(静态编辑文本edtText;)
  • 使活动的onDestroy()中的编辑文本引用为空