diff options
| -rw-r--r-- | core/java/android/widget/ToastPresenter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/widget/ToastPresenter.java b/core/java/android/widget/ToastPresenter.java index 7cb61fe597db..89271b5cc51f 100644 --- a/core/java/android/widget/ToastPresenter.java +++ b/core/java/android/widget/ToastPresenter.java @@ -342,7 +342,10 @@ public class ToastPresenter { // to cancel the toast there is an inherent race and we may attempt to add a window // after the token has been invalidated. Let us hedge against that. Log.w(TAG, "Error while attempting to show toast from " + mPackageName, e); - return; + } catch (WindowManager.InvalidDisplayException e) { + // Display the toast was scheduled on might have been meanwhile removed. + Log.w(TAG, "Cannot show toast from " + mPackageName + + " on display it was scheduled on.", e); } } } |