From b0db5940c9c444d79f0bcae6526f390a99c01037 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Tue, 4 Jan 2011 13:58:54 -0800 Subject: [PATCH] Fix for an NPE in Account settings on long press. Bug 3333512 Change-Id: Ief79e824b86b964598f00ef74c6b5c61c0730242 --- api/current.xml | 2 +- core/java/android/widget/TextView.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/current.xml b/api/current.xml index 4ca0b39a9e7f2..57a76de659949 100644 --- a/api/current.xml +++ b/api/current.xml @@ -258003,7 +258003,7 @@ deprecated="not deprecated" visibility="public" > - + diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index af3ffe5afbb3f..cc5be00d19e5a 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7854,7 +7854,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener MenuHandler handler = new MenuHandler(); - if (mText instanceof Spanned) { + if (mText instanceof Spanned && hasSelectionController()) { long lastTouchOffset = getLastTouchOffsets(); final int selStart = extractRangeStartFromLong(lastTouchOffset); final int selEnd = extractRangeEndFromLong(lastTouchOffset);