Merge "Fix for an NPE in TextView." into gingerbread

This commit is contained in:
Gilles Debunne
2010-08-24 14:23:37 -07:00
committed by Android (Google) Code Review

View File

@@ -6469,10 +6469,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
if (!mFrozenWithFocus || (selStart < 0 || selEnd < 0)) { if (!mFrozenWithFocus || (selStart < 0 || selEnd < 0)) {
boolean selMoved = mSelectionMoved; boolean selMoved = mSelectionMoved;
final int touchOffset = if (mSelectionModifierCursorController != null) {
((SelectionModifierCursorController) mSelectionModifierCursorController). final int touchOffset =
getMinTouchOffset(); ((SelectionModifierCursorController) mSelectionModifierCursorController).
Selection.setSelection((Spannable) mText, touchOffset); getMinTouchOffset();
Selection.setSelection((Spannable) mText, touchOffset);
}
if (mMovement != null) { if (mMovement != null) {
mMovement.onTakeFocus(this, (Spannable) mText, direction); mMovement.onTakeFocus(this, (Spannable) mText, direction);