From 2d8047699768b1487323ee4603f91268df490d60 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Thu, 5 Nov 2009 16:02:32 -0500 Subject: The apps might not have finished loading by the time we're doing this. Fixes bug 2241755. --- src/com/android/launcher2/AllAppsView.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java index 5a315dd78..37eb21636 100644 --- a/src/com/android/launcher2/AllAppsView.java +++ b/src/com/android/launcher2/AllAppsView.java @@ -253,7 +253,6 @@ public class AllAppsView extends RSSurfaceView if (!isVisible()) { return false; } - final int iconCount = mRollo.mState.iconCount; if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) { @@ -553,6 +552,11 @@ public class AllAppsView extends RSSurfaceView } public void addApps(ArrayList list) { + if (mAllAppsList == null) { + // Not done loading yet. We'll find out about it later. + return; + } + final int N = list.size(); if (mRollo != null) { mRollo.reallocAppsList(mRollo.mState.iconCount + N); @@ -578,6 +582,11 @@ public class AllAppsView extends RSSurfaceView } public void removeApps(ArrayList list) { + if (mAllAppsList == null) { + // Not done loading yet. We'll find out about it later. + return; + } + final int N = list.size(); for (int i=0; i= mAllAppsList.size()) { + if (mAllAppsList == null || index < 0 || index >= mAllAppsList.size()) { mState.selectedIconIndex = -1; } else { mState.selectedIconIndex = index; -- cgit v1.2.3