From 959f603a93cdb378b52e852e06c9e32c514ccd84 Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Mon, 27 Sep 2010 11:42:53 -0700 Subject: [PATCH] Fix crash on small-screen devices Allow for mCustomizePagedView to be null in more cases. Bug: 3040307 Change-Id: Idf5e50e661bcffa726db204a3318ab932db265aa --- src/com/android/launcher2/Launcher.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 0671063c3c..c8fc074a44 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -3003,7 +3003,9 @@ public final class Launcher extends Activity */ public void bindAllApplications(ArrayList apps) { mAllAppsGrid.setApps(apps); - mCustomizePagedView.setApps(apps); + if (mCustomizePagedView != null) { + mCustomizePagedView.setApps(apps); + } updateAppMarketIcon(); } @@ -3015,7 +3017,9 @@ public final class Launcher extends Activity public void bindAppsAdded(ArrayList apps) { removeDialog(DIALOG_CREATE_SHORTCUT); mAllAppsGrid.addApps(apps); - mCustomizePagedView.addApps(apps); + if (mCustomizePagedView != null) { + mCustomizePagedView.addApps(apps); + } updateAppMarketIcon(); } @@ -3028,7 +3032,9 @@ public final class Launcher extends Activity removeDialog(DIALOG_CREATE_SHORTCUT); mWorkspace.updateShortcuts(apps); mAllAppsGrid.updateApps(apps); - mCustomizePagedView.updateApps(apps); + if (mCustomizePagedView != null) { + mCustomizePagedView.updateApps(apps); + } updateAppMarketIcon(); } @@ -3043,7 +3049,9 @@ public final class Launcher extends Activity mWorkspace.removeItems(apps); } mAllAppsGrid.removeApps(apps); - mCustomizePagedView.removeApps(apps); + if (mCustomizePagedView != null) { + mCustomizePagedView.removeApps(apps); + } updateAppMarketIcon(); }