diff options
author | Winson Chung <winsonc@google.com> | 2011-02-23 16:26:38 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-02-23 16:26:38 -0800 |
commit | 981abb6f8950f1b5c4252ce6fda9b27f0296f5d3 (patch) | |
tree | 8a2c2fa2bd5294b24f814c2aa1f0b649cf4bb553 /src/com | |
parent | 44316458da2b79c0a02acb1c4a6d2ae8dd558a3b (diff) | |
parent | 8b53478a98836d68ca56486fb284022c49417b6f (diff) | |
download | android_packages_apps_Trebuchet-981abb6f8950f1b5c4252ce6fda9b27f0296f5d3.tar.gz android_packages_apps_Trebuchet-981abb6f8950f1b5c4252ce6fda9b27f0296f5d3.tar.bz2 android_packages_apps_Trebuchet-981abb6f8950f1b5c4252ce6fda9b27f0296f5d3.zip |
Merge "Pre-initializing filtered/apps list in case we get incremental updates before setApps(), adding additional null checks. (3465095)"
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher2/AllAppsPagedView.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java index e9269743b..bfe6ec171 100644 --- a/src/com/android/launcher2/AllAppsPagedView.java +++ b/src/com/android/launcher2/AllAppsPagedView.java @@ -79,6 +79,8 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All mCellCountX = a.getInt(R.styleable.PagedView_cellCountX, 6); mCellCountY = a.getInt(R.styleable.PagedView_cellCountY, 4); mInflater = LayoutInflater.from(context); + mApps = new ArrayList<ApplicationInfo>(); + mFilteredApps = new ArrayList<ApplicationInfo>(); a.recycle(); setSoundEffectsEnabled(false); @@ -390,12 +392,14 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All } private int findAppByComponent(ArrayList<ApplicationInfo> list, ApplicationInfo item) { - ComponentName removeComponent = item.intent.getComponent(); - final int length = list.size(); - for (int i = 0; i < length; ++i) { - ApplicationInfo info = list.get(i); - if (info.intent.getComponent().equals(removeComponent)) { - return i; + if (item != null && item.intent != null) { + ComponentName removeComponent = item.intent.getComponent(); + final int length = list.size(); + for (int i = 0; i < length; ++i) { + ApplicationInfo info = list.get(i); + if (info.intent.getComponent().equals(removeComponent)) { + return i; + } } } return -1; |