summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-02-23 13:43:59 -0800
committerWinson Chung <winsonc@google.com>2011-02-23 13:45:03 -0800
commit8b53478a98836d68ca56486fb284022c49417b6f (patch)
tree90bacc373bb4867bb5ca232a127d5e6079b1a64e /src/com/android
parent199b299308110acd2a887f717dc284c07b092ee3 (diff)
downloadandroid_packages_apps_Trebuchet-8b53478a98836d68ca56486fb284022c49417b6f.tar.gz
android_packages_apps_Trebuchet-8b53478a98836d68ca56486fb284022c49417b6f.tar.bz2
android_packages_apps_Trebuchet-8b53478a98836d68ca56486fb284022c49417b6f.zip
Pre-initializing filtered/apps list in case we get incremental updates before setApps(), adding additional null checks. (3465095)
Change-Id: Ie53fe7ed4fc55a587f8f831902ed5ee2d87bc98e
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/AllAppsPagedView.java16
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;