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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user