Loading core/java/android/widget/TextView.java +7 −3 Original line number Diff line number Diff line Loading @@ -7577,12 +7577,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } String getSelectedText() { if (hasSelection()) { return String.valueOf(mText.subSequence(getSelectionStart(), getSelectionEnd())); } if (!hasSelection()) { return null; } final int start = getSelectionStart(); final int end = getSelectionEnd(); return String.valueOf( start > end ? mText.subSequence(end, start) : mText.subSequence(start, end)); } /** * Sets the properties of this field (lines, horizontally scrolling, * transformation method) to be for a single-line input. Loading Loading
core/java/android/widget/TextView.java +7 −3 Original line number Diff line number Diff line Loading @@ -7577,12 +7577,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } String getSelectedText() { if (hasSelection()) { return String.valueOf(mText.subSequence(getSelectionStart(), getSelectionEnd())); } if (!hasSelection()) { return null; } final int start = getSelectionStart(); final int end = getSelectionEnd(); return String.valueOf( start > end ? mText.subSequence(end, start) : mText.subSequence(start, end)); } /** * Sets the properties of this field (lines, horizontally scrolling, * transformation method) to be for a single-line input. Loading