Skip to content

Commit 149cecd

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Bug 5151927 - Monkeys should not play with detached lists."
2 parents f28c539 + a2b986e commit 149cecd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/java/android/widget/AbsListView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
635635
/**
636636
* Track if we are currently attached to a window.
637637
*/
638-
private boolean mIsAttached;
638+
boolean mIsAttached;
639639

640640
/**
641641
* Track the item count from the last time we handled a data change.

core/java/android/widget/ListView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ public boolean onKeyUp(int keyCode, KeyEvent event) {
20742074
}
20752075

20762076
private boolean commonKey(int keyCode, int count, KeyEvent event) {
2077-
if (mAdapter == null) {
2077+
if (mAdapter == null || !mIsAttached) {
20782078
return false;
20792079
}
20802080

0 commit comments

Comments
 (0)