OSDN Git Service

Explicit documentation for View.getTag() return value when not set
authorAlan Viverette <alanv@google.com>
Thu, 16 Jan 2014 23:55:25 +0000 (15:55 -0800)
committerAlan Viverette <alanv@google.com>
Thu, 16 Jan 2014 23:55:25 +0000 (15:55 -0800)
Change-Id: I143d445b0c801ffabe04f0042e559594e52d07ed

core/java/android/view/View.java

index a382600..52b1b39 100644 (file)
@@ -1645,7 +1645,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
      * @see #setTag(Object)
      * @see #getTag()
      */
-    protected Object mTag;
+    protected Object mTag = null;
 
     // for mPrivateFlags:
     /** {@hide} */
@@ -16442,7 +16442,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     /**
      * Returns this view's tag.
      *
-     * @return the Object stored in this view as a tag
+     * @return the Object stored in this view as a tag, or {@code null} if not
+     *         set
      *
      * @see #setTag(Object)
      * @see #getTag(int)
@@ -16472,7 +16473,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
      *
      * @param key The key identifying the tag
      *
-     * @return the Object stored in this view as a tag
+     * @return the Object stored in this view as a tag, or {@code null} if not
+     *         set
      *
      * @see #setTag(int, Object)
      * @see #getTag()