diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 6631f2687a7c4..310b4740e97ec 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -5231,7 +5231,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // ExtractEditText does not call onFocus when it is displayed, and mHasSelectionOnFocus can // not be set. Do the test here instead. if (isInExtractedMode() && hasSelection() && mEditor != null - && mEditor.mTextActionMode == null) { + && mEditor.mTextActionMode == null && isShown() && hasWindowFocus()) { mEditor.startSelectionActionMode(); }