diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index ea767f676317c..f70051d0a0fff 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -1551,9 +1551,9 @@ public class GridView extends AbsListView { int nextPage = -1; if (direction == FOCUS_UP) { - nextPage = Math.max(0, mSelectedPosition - getChildCount() - 1); + nextPage = Math.max(0, mSelectedPosition - getChildCount()); } else if (direction == FOCUS_DOWN) { - nextPage = Math.min(mItemCount - 1, mSelectedPosition + getChildCount() - 1); + nextPage = Math.min(mItemCount - 1, mSelectedPosition + getChildCount()); } if (nextPage >= 0) {