From 7affb23aa8e09555251971dbe2f07f7e095e405b Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Wed, 8 Jun 2011 15:50:14 -0700 Subject: [PATCH] DO NOT MERGE temp fix for NPE Bug #3508479 Change-Id: I25c8aec546e2fe13c954fe362a4231e05039e607 --- src/com/android/launcher2/Launcher.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 1d48407728..5c5542aa8c 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -3102,6 +3102,7 @@ public final class Launcher extends Activity private Drawable.ConstantState updateTextButtonWithIconFromExternalActivity( int buttonId, ComponentName activityName, int fallbackDrawableId) { TextView button = (TextView) findViewById(buttonId); + if (button == null) return null; Drawable toolbarIcon = getExternalPackageToolbarIcon(activityName); // If we were unable to find the icon via the meta-data, use a generic one @@ -3118,6 +3119,7 @@ public final class Launcher extends Activity private Drawable.ConstantState updateButtonWithIconFromExternalActivity( int buttonId, ComponentName activityName, int fallbackDrawableId) { ImageView button = (ImageView) findViewById(buttonId); + if (button == null) return null; Drawable toolbarIcon = getExternalPackageToolbarIcon(activityName); // If we were unable to find the icon via the meta-data, use a generic one @@ -3132,11 +3134,13 @@ public final class Launcher extends Activity private void updateTextButtonWithDrawable(int buttonId, Drawable.ConstantState d) { TextView button = (TextView) findViewById(buttonId); + if (button == null) return; button.setCompoundDrawables(d.newDrawable(getResources()), null, null, null); } private void updateButtonWithDrawable(int buttonId, Drawable.ConstantState d) { ImageView button = (ImageView) findViewById(buttonId); + if (button == null) return; button.setImageDrawable(d.newDrawable(getResources())); }