Skip to content

Commit 80ec4ab

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug 5339708 - edge case in ListView focus restoration"
2 parents 81453f7 + 2d8b017 commit 80ec4ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/java/android/widget/ListView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,7 @@ protected void layoutChildren() {
16511651
// are focusable
16521652
if (mItemsCanFocus && hasFocus() && !sel.hasFocus()) {
16531653
final boolean focusWasTaken = (sel == focusLayoutRestoreDirectChild &&
1654+
focusLayoutRestoreView != null &&
16541655
focusLayoutRestoreView.requestFocus()) || sel.requestFocus();
16551656
if (!focusWasTaken) {
16561657
// selected item didn't take focus, fine, but still want

0 commit comments

Comments
 (0)