diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2015-04-08 18:11:42 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-08 18:11:44 +0000 |
| commit | 2a39aef4398b332eceddf09b34f64747caa48249 (patch) | |
| tree | bb0630f99714df7f074cb98b87ed816741dbdb6f /core/java | |
| parent | a323e3f3366321ce63d1f465d7dfe8bdc0e95679 (diff) | |
| parent | 74a94059c6b12c2dbbf2d475d6c09a665482a4e7 (diff) | |
| download | frameworks_base-2a39aef4398b332eceddf09b34f64747caa48249.zip frameworks_base-2a39aef4398b332eceddf09b34f64747caa48249.tar.gz frameworks_base-2a39aef4398b332eceddf09b34f64747caa48249.tar.bz2 | |
Merge "Fix crash when removing draw listener"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/ActionMenuPresenter.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/widget/ActionMenuPresenter.java b/core/java/android/widget/ActionMenuPresenter.java index 710d59e..36bce0b 100644 --- a/core/java/android/widget/ActionMenuPresenter.java +++ b/core/java/android/widget/ActionMenuPresenter.java @@ -381,12 +381,13 @@ public class ActionMenuPresenter extends BaseMenuPresenter computeMenuItemAnimationInfo(true); final ViewTreeObserver observer = menuViewParent.getViewTreeObserver(); if (observer != null) { - observer.addOnDrawListener(new ViewTreeObserver.OnDrawListener() { + observer.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { @Override - public void onDraw() { + public boolean onPreDraw() { computeMenuItemAnimationInfo(false); - observer.removeOnDrawListener(this); + observer.removeOnPreDrawListener(this); runItemAnimations(); + return true; } }); } |
