Skip to content

Commit cb18db8

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug 5312352 - ListView modal multi-select mode bugs"
2 parents c924fbd + 1e83b3e commit cb18db8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/java/android/widget/AbsListView.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,13 +2576,11 @@ boolean performLongPress(final View child,
25762576
final int longPressPosition, final long longPressId) {
25772577
// CHOICE_MODE_MULTIPLE_MODAL takes over long press.
25782578
if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
2579-
if (mChoiceActionMode == null) {
2580-
mChoiceActionMode = startActionMode(mMultiChoiceModeCallback);
2579+
if (mChoiceActionMode == null &&
2580+
(mChoiceActionMode = startActionMode(mMultiChoiceModeCallback)) != null) {
25812581
setItemChecked(longPressPosition, true);
2582+
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
25822583
}
2583-
// TODO Should we select the long pressed item if we were already in
2584-
// selection mode? (i.e. treat it like an item click?)
2585-
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
25862584
return true;
25872585
}
25882586

0 commit comments

Comments
 (0)