Adding check before we try and remove associated holographic icons (in the case there are none generated).
Change-Id: If06693f7218c3388c3ba6481a07655ed7386391d
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 54bdec4..6a3c84d 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -169,7 +169,11 @@
@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