From 161abf3d44feebb8462f7d0cbee81574d666234b Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Wed, 23 May 2012 17:22:49 -0700 Subject: Fix a bug with deferred position scrolling in lists while data changes are pending Save the pending position scroll until the data change is actually serviced before posting it to run. This avoids handler loops on GONE subtrees or when the view is detached. Bug 6547649 Change-Id: Iab108cfcb7dd11ece703762d311a5f5985f38c3b --- core/java/android/widget/GridView.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/java/android/widget/GridView.java') diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index 0a40d5efba5d..897510940721 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -1275,6 +1275,10 @@ public class GridView extends AbsListView { mLayoutMode = LAYOUT_NORMAL; mDataChanged = false; + if (mPositionScrollAfterLayout != null) { + post(mPositionScrollAfterLayout); + mPositionScrollAfterLayout = null; + } mNeedSync = false; setNextSelectedPositionInt(mSelectedPosition); -- cgit v1.2.3