diff options
author | Adam Powell <adamp@google.com> | 2011-09-02 17:01:28 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-02 17:01:28 -0700 |
commit | a59e3146b7dc298043e43e1816e3415b2583a3c8 (patch) | |
tree | d2a28db8b6d7c999fa10d2e941596cdce2dc856f | |
parent | 44671725bf9abbf34999d7afd3e998d2c4c6cd1a (diff) | |
parent | e1bf486846ce7589727ad84440bd9a2d42751055 (diff) | |
download | frameworks_base-a59e3146b7dc298043e43e1816e3415b2583a3c8.zip frameworks_base-a59e3146b7dc298043e43e1816e3415b2583a3c8.tar.gz frameworks_base-a59e3146b7dc298043e43e1816e3415b2583a3c8.tar.bz2 |
Merge "Fix bug 5201420 - Appease the monkeys"
-rw-r--r-- | core/java/android/widget/ListView.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 133f435..5a97317 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -3384,11 +3384,11 @@ public class ListView extends AbsListView { protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); + final ListAdapter adapter = mAdapter; int closetChildIndex = -1; - if (gainFocus && previouslyFocusedRect != null) { + if (adapter != null && gainFocus && previouslyFocusedRect != null) { previouslyFocusedRect.offset(mScrollX, mScrollY); - final ListAdapter adapter = mAdapter; // Don't cache the result of getChildCount or mFirstPosition here, // it could change in layoutChildren. if (adapter.getCount() < getChildCount() + mFirstPosition) { |