MenuHandler handler = new MenuHandler();
<<<<<<< HEAD
if (mText instanceof Spanned) {
int selStart = getSelectionStart();
int selEnd = getSelectionEnd();
=======
if (canSelectText()) {
if (!hasPasswordTransformationMethod()) {
// selectCurrentWord is not available on a password field and would return an
// arbitrary 10-charater selection around pressed position. Discard it.
// SelectAll is still useful to be able to clear the field using the delete key.
menu.add(0, ID_START_SELECTING_TEXT, 0, com.android.internal.R.string.selectText).
setOnMenuItemClickListener(handler);
}
menu.add(0, ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll).
setOnMenuItemClickListener(handler).
setAlphabeticShortcut('a');
added = true;
}
>>>>>>> 6775754ae3b765e50466048ab02a8d43d0ea6c61
int min = Math.min(selStart, selEnd);
int max = Math.max(selStart, selEnd); |