From b3715fe227dfaafa66479228276ef0329925085f Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 16 May 2011 16:28:53 -0700 Subject: Adding check before we try and remove associated holographic icons (in the case there are none generated). Change-Id: If06693f7218c3388c3ba6481a07655ed7386391d --- src/com/android/launcher2/PagedViewCellLayout.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/com/android') diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java index 54bdec40c..6a3c84d03 100644 --- a/src/com/android/launcher2/PagedViewCellLayout.java +++ b/src/com/android/launcher2/PagedViewCellLayout.java @@ -169,7 +169,11 @@ public class PagedViewCellLayout extends ViewGroup implements Page { @Override public void removeViewOnPageAt(int index) { mChildren.removeViewAt(index); - mHolographicChildren.removeViewAt(index); + // Holographic icons are disabled in certain cases (on lower hardware, or if there is only + // one page), so check before we try and remove the view at a specified index. + if (mHolographicChildren.getChildAt(index) != null) { + mHolographicChildren.removeViewAt(index); + } } @Override -- cgit v1.2.3