Fix crash on small-screen devices
Allow for mCustomizePagedView to be null in more cases.
Bug: 3040307
Change-Id: Idf5e50e661bcffa726db204a3318ab932db265aa
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 0671063..c8fc074 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3003,7 +3003,9 @@
*/
public void bindAllApplications(ArrayList<ApplicationInfo> apps) {
mAllAppsGrid.setApps(apps);
- mCustomizePagedView.setApps(apps);
+ if (mCustomizePagedView != null) {
+ mCustomizePagedView.setApps(apps);
+ }
updateAppMarketIcon();
}
@@ -3015,7 +3017,9 @@
public void bindAppsAdded(ArrayList<ApplicationInfo> apps) {
removeDialog(DIALOG_CREATE_SHORTCUT);
mAllAppsGrid.addApps(apps);
- mCustomizePagedView.addApps(apps);
+ if (mCustomizePagedView != null) {
+ mCustomizePagedView.addApps(apps);
+ }
updateAppMarketIcon();
}
@@ -3028,7 +3032,9 @@
removeDialog(DIALOG_CREATE_SHORTCUT);
mWorkspace.updateShortcuts(apps);
mAllAppsGrid.updateApps(apps);
- mCustomizePagedView.updateApps(apps);
+ if (mCustomizePagedView != null) {
+ mCustomizePagedView.updateApps(apps);
+ }
updateAppMarketIcon();
}
@@ -3043,7 +3049,9 @@
mWorkspace.removeItems(apps);
}
mAllAppsGrid.removeApps(apps);
- mCustomizePagedView.removeApps(apps);
+ if (mCustomizePagedView != null) {
+ mCustomizePagedView.removeApps(apps);
+ }
updateAppMarketIcon();
}