Merge "Fix bug 3005359 - onListItemClick and ActionMode conflict"
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 9e7cc44..740521b 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -856,6 +856,7 @@
@Override
public boolean performItemClick(View view, int position, long id) {
boolean handled = false;
+ boolean dispatchItemClick = true;
if (mChoiceMode != CHOICE_MODE_NONE) {
handled = true;
@@ -879,6 +880,7 @@
if (mChoiceActionMode != null) {
mMultiChoiceModeCallback.onItemCheckedStateChanged(mChoiceActionMode,
position, id, newValue);
+ dispatchItemClick = false;
}
} else if (mChoiceMode == CHOICE_MODE_SINGLE) {
boolean newValue = !mCheckStates.get(position, false);
@@ -900,7 +902,9 @@
requestLayout();
}
- handled |= super.performItemClick(view, position, id);
+ if (dispatchItemClick) {
+ handled |= super.performItemClick(view, position, id);
+ }
return handled;
}