From 4324eadc89676e860d063fb5f18aabc9f335a48b Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Wed, 24 Aug 2011 21:31:03 -0700 Subject: [PATCH] Fix issue with views becoming visible with stale content. An earlier fix nooop'd invalidate calls on non-visible views. This caused an issue where changes to the view while it was not visible (such as changing the text of a TextView) would not get picked up by the invalidation process. The fix is to automatically invalidate() a view when it becomes visible, to account for any changes that may have occurred to its content while it was not visible. Change-Id: Ia0f8fb42ca627b5a38f08761fa622b23f2dfa38b --- core/java/android/view/View.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 17e637c57cc5e..e97d88fdad518 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -6433,10 +6433,10 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit if ((flags & VISIBILITY_MASK) == VISIBLE) { if ((changed & VISIBILITY_MASK) != 0) { /* - * If this view is becoming visible, set the DRAWN flag so that - * the next invalidate() will not be skipped. + * If this view is becoming visible, invalidate it in case it changed while + * it was not visible. */ - mPrivateFlags |= DRAWN; + invalidate(true); needGlobalAttributesUpdate(true);