Fix bug 3367627 - spontaneous crash

Fix a little-traversed codepath that could cause some grief.

Change-Id: I75e6931c3208a0f18b40446f23a2fdd5a0065ce8
This commit is contained in:
Adam Powell
2011-01-23 19:17:53 -08:00
parent 2cd06609b4
commit 2bed570bba

View File

@@ -1095,9 +1095,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
*/
private boolean contentFits() {
final int childCount = getChildCount();
if (childCount != mItemCount) {
return false;
}
if (childCount == 0) return true;
if (childCount != mItemCount) return false;
return getChildAt(0).getTop() >= 0 && getChildAt(childCount - 1).getBottom() <= mBottom;
}