summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2011-01-13 22:21:15 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-01-13 22:21:15 -0800
commit2421cd42292b3593716407847d2957f71c92c1fe (patch)
tree9563de571051e450b1153c59e90b9166435988d6
parent84543705138ed67494b9ecd64fadf4ab0bf46a0e (diff)
parent79303750df0e4d18f51f64c7ef3ca21fca893bbb (diff)
Merge "Fix bug 3352112 - crash in AbsListView.smoothScrollBy" into honeycomb
-rw-r--r--core/java/android/widget/AbsListView.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 2e38743b95b7..7631df49e6bb 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -4106,8 +4106,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int topLimit = getPaddingTop();
final int bottomLimit = getHeight() - getPaddingBottom();
- if (distance == 0 ||
- firstPos == INVALID_POSITION ||
+ if (distance == 0 || mItemCount == 0 || childCount == 0 ||
(firstPos == 0 && getChildAt(0).getTop() == topLimit && distance < 0) ||
(lastPos == mItemCount - 1 &&
getChildAt(childCount - 1).getBottom() == bottomLimit && distance > 0)) {