summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/BubbleTextView.java
diff options
context:
space:
mode:
authorPatrick Dubroy <dubroy@google.com>2011-03-15 10:29:01 -0700
committerPatrick Dubroy <dubroy@google.com>2011-03-15 10:29:01 -0700
commitd69e11384c9eefe49039b198edcece5d59c8868f (patch)
treef50555f329934adf2080fee639a0e06a6c9575a9 /src/com/android/launcher2/BubbleTextView.java
parent3499d8c89d6b5989579880bf80df31df46483304 (diff)
downloadandroid_packages_apps_Trebuchet-d69e11384c9eefe49039b198edcece5d59c8868f.tar.gz
android_packages_apps_Trebuchet-d69e11384c9eefe49039b198edcece5d59c8868f.tar.bz2
android_packages_apps_Trebuchet-d69e11384c9eefe49039b198edcece5d59c8868f.zip
Fix 4093841: Launcher crash after downloading app & hitting back
The last change to fix the "blue glow gone wild" re-introduced a NPE caused by setting the pressed state of a BubbleTextView which has been detached. Change-Id: I726bace77dd04b6ac8f3e170dd9e1df00a183384
Diffstat (limited to 'src/com/android/launcher2/BubbleTextView.java')
-rw-r--r--src/com/android/launcher2/BubbleTextView.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index f18a24197..146485489 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -264,8 +264,10 @@ public class BubbleTextView extends TextView implements VisibilityChangedBroadca
void setCellLayoutPressedOrFocusedIcon() {
CellLayoutChildren parent = (CellLayoutChildren) getParent();
- CellLayout cellLayout = (CellLayout) parent.getParent();
- cellLayout.setPressedOrFocusedIcon((mPressedOrFocusedBackground != null) ? this : null);
+ if (parent != null) {
+ CellLayout layout = (CellLayout) parent.getParent();
+ layout.setPressedOrFocusedIcon((mPressedOrFocusedBackground != null) ? this : null);
+ }
}
Bitmap getPressedOrFocusedBackground() {