From e023ea6880e8d3fab75616351d7bbb7ea384579b Mon Sep 17 00:00:00 2001 From: Yky Date: Sun, 4 Oct 2015 20:33:32 +0200 Subject: [PATCH] ignore leakcanary issue #297; AOSP issue #188551 --- .../com/squareup/leakcanary/AndroidExcludedRefs.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java b/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java index 605e86dcbf..07fe8cdf17 100644 --- a/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java +++ b/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java @@ -384,6 +384,18 @@ public enum AndroidExcludedRefs { } }; + EDITTEXT_BLINK_MESSAGEQEUE { + @Override void add(ExludedRefs.Builder excluded) { + // The EditText Blink of the Cursor is implemented using a callback and Messages, which + // trigger the display of the Cursor. If an AlertDialog or DialogFragment that contains a + // blinking cursor is detached a message is posted with a delay after the + // dialog has been closed and as a result leaks the Activity. + // This can be fixed manually by calling setCursorEnabled(false) in the dismiss() method of + // the dialog + excluded.instanceField("android.widget.EditText", "mContext"); + } + } + /** * This returns the references in the leak path that should be ignored by all on Android. */