summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/TextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/TextView.java')
-rw-r--r--core/java/android/widget/TextView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index dde16ea..44f30f4 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -7052,14 +7052,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return -1;
}
- int end = offset;
+ int len = mText.length();
+ int end = Math.min(offset, len);
if (end < 0) {
return -1;
}
int start = end;
- int len = mText.length();
for (; start > 0; start--) {
char c = mTransformed.charAt(start - 1);