OSDN Git Service

Made context menu appear when tapping inside selection.
authorGilles Debunne <debunne@google.com>
Thu, 9 Sep 2010 17:40:22 +0000 (10:40 -0700)
committerGilles Debunne <debunne@google.com>
Thu, 9 Sep 2010 17:53:16 +0000 (10:53 -0700)
Change-Id: I7ca274b007f4daea7d37a3d6b10b9504874b3c49

core/java/android/widget/TextView.java

index fea53e5..861a46d 100644 (file)
@@ -6628,6 +6628,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
 
         if (start == end) {
             if (start >= prevStart && start < prevEnd) {
+                // Restore previous selection
+                Selection.setSelection((Spannable)mText, prevStart, prevEnd);
                 // Tapping inside the selection displays the cut/copy/paste context menu.
                 showContextMenu();
                 return;