Fix regression in ListView click handling

Regression caused by patch a607223f34

If an item click handler results in the ListView becoming detached
from the window, the performClick runnable could be executed twice.
Null out the mTouchModeReset runnable before running the click handler
so that it is not run by the detach handler.

Change-Id: I2fab60232027bb4876f9912088e0ffb9b17d308c
This commit is contained in:
Adam Powell
2012-12-11 15:41:17 -08:00
committed by Adam Powell
parent 7419905676
commit 847be7445e

View File

@@ -3416,13 +3416,13 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mTouchModeReset = new Runnable() {
@Override
public void run() {
mTouchModeReset = null;
mTouchMode = TOUCH_MODE_REST;
child.setPressed(false);
setPressed(false);
if (!mDataChanged) {
performClick.run();
}
mTouchModeReset = null;
}
};
postDelayed(mTouchModeReset,