Skip to content

Commit 857c341

Browse files
author
Gilles Debunne
committed
Fixed cast exception with selectable text.
Bug 6550358 The EditText constructor now calls setTextIsSelectable, which uses getText where the cast exception happens because the EditText is not yet fully built and its text does not have the right type. Fixed by using mText directly instead of getText(). Change-Id: I52a2720ae99475881f210ac74464728cab92147e
1 parent 6cd19e0 commit 857c341

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/java/android/widget/TextView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4656,7 +4656,7 @@ public void setTextIsSelectable(boolean selectable) {
46564656
// mInputType should already be EditorInfo.TYPE_NULL and mInput should be null
46574657

46584658
setMovementMethod(selectable ? ArrowKeyMovementMethod.getInstance() : null);
4659-
setText(getText(), selectable ? BufferType.SPANNABLE : BufferType.NORMAL);
4659+
setText(mText, selectable ? BufferType.SPANNABLE : BufferType.NORMAL);
46604660

46614661
// Called by setText above, but safer in case of future code changes
46624662
mEditor.prepareCursorControllers();

0 commit comments

Comments
 (0)