From 3b8a5ea036670421ef962d6ed8b22d214e933711 Mon Sep 17 00:00:00 2001 From: Abodunrinwa Toki Date: Tue, 20 Oct 2015 00:19:23 +0100 Subject: Re-set PROCESS_TEXT selection if nothing was returned. Bug: 25043887 Change-Id: If069a5e23f1adf6a2c3aac8fe7e3f19cff2e28ad --- core/java/android/widget/TextView.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core') diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index a1462c4..d8139b8 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -1474,7 +1474,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } } + } else if (mText instanceof Spannable) { + // Reset the selection. + stopTextActionMode(); + Selection.setSelection((Spannable) mText, getSelectionStart(), getSelectionEnd()); } + if (mEditor.hasSelectionController()) { mEditor.startSelectionActionMode(); } -- cgit v1.1