summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Parkinson <ianp@google.com>2014-01-21 13:09:59 +0000
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:27 -0700
commite1940a6731f8dcf81062dc80344b4d437f00f62e (patch)
tree0e428a73c73a386544bf7be0a4344ba61b23686e /src
parent06fa60d9896845d8c70bc4cb233e35041498e137 (diff)
downloadandroid_packages_apps_Trebuchet-e1940a6731f8dcf81062dc80344b4d437f00f62e.tar.gz
android_packages_apps_Trebuchet-e1940a6731f8dcf81062dc80344b4d437f00f62e.tar.bz2
android_packages_apps_Trebuchet-e1940a6731f8dcf81062dc80344b4d437f00f62e.zip
Avoid NPE from delayed Runnable
Naive fix to b/12656485. Other Runnables in Launcher similarly check that mWorkspace hasn't become null between being posted and being executed, so I think this is probably appropriate. Bug: 12656485 Change-Id: Ib4f3d0e8686c6249fe838144b1e8120c85f66f01
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Launcher.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index e951f87ae..943e5fec5 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -4126,9 +4126,11 @@ public class Launcher extends Activity
// when we are loading right after we return to launcher.
mWorkspace.postDelayed(new Runnable() {
public void run() {
- mWorkspace.snapToPage(newScreenIndex);
- mWorkspace.postDelayed(startBounceAnimRunnable,
- NEW_APPS_ANIMATION_DELAY);
+ if (mWorkspace != null) {
+ mWorkspace.snapToPage(newScreenIndex);
+ mWorkspace.postDelayed(startBounceAnimRunnable,
+ NEW_APPS_ANIMATION_DELAY);
+ }
}
}, NEW_APPS_PAGE_MOVE_DELAY);
} else {