From c31820d29cd51a1f46f8ccf9f301a3e7c36d3af2 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Sun, 16 Jan 2011 16:57:05 -0800 Subject: NPE fix --- src/com/android/launcher2/AllAppsPagedView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java index c9c069f12..a15b73b18 100644 --- a/src/com/android/launcher2/AllAppsPagedView.java +++ b/src/com/android/launcher2/AllAppsPagedView.java @@ -221,11 +221,13 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All public void run() { DeleteZone allAppsDeleteZone = (DeleteZone) mLauncher.findViewById(R.id.all_apps_delete_zone); - allAppsDeleteZone.setDragAndDropEnabled(false); + // if onDestroy was called on Launcher, we might have already deleted the + // all apps delete zone / info button, so check if they are null + if (allAppsDeleteZone != null) allAppsDeleteZone.setDragAndDropEnabled(false); ApplicationInfoDropTarget allAppsInfoButton = (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.all_apps_info_target); - allAppsInfoButton.setDragAndDropEnabled(false); + if (allAppsInfoButton != null) allAppsInfoButton.setDragAndDropEnabled(false); } }); resetCheckedGrandchildren(); -- cgit v1.2.3