OSDN Git Service

Add a method to clear info about a contact
authorTom Taylor <tomtaylor@google.com>
Thu, 22 Oct 2009 23:36:53 +0000 (16:36 -0700)
committerTom Taylor <tomtaylor@google.com>
Fri, 23 Oct 2009 20:33:25 +0000 (13:33 -0700)
Add a method so the ContactInfoWidget will throw away the cached
info it has on a contact (e.g. picture and uri).

Change-Id: Ia8f376e356c6bcf246bbd72239c5ca2a3b7c9574

core/java/com/android/internal/widget/ContactHeaderWidget.java

index b98794b..d441155 100644 (file)
@@ -408,6 +408,17 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
                 PHONE_LOOKUP_PROJECTION, null, null, null);
     }
 
+    /**
+     * Method to force this widget to forget everything it knows about the contact.
+     * The widget isn't automatically updated or redrawn.
+     *
+     */
+    public void wipeClean() {
+        setPhoto(null);
+        mContactUri = null;
+        mExcludeMimes = null;
+    }
+
     private void startContactQuery(Uri contactUri) {
         mQueryHandler.startQuery(TOKEN_CONTACT_INFO, null, contactUri, ContactQuery.COLUMNS,
                 null, null, null);