From 158c19020b60cf1c807d8bf40052b7091b2c08c4 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Tue, 9 Jun 2009 12:07:28 -0500 Subject: Fix logic inversion in ListView Javadoc The Javadoc for isItemChecked, getCheckedItemPosition, and getCheckedItemPositions stated the return was valid if conditions were the inverse of what the method checked for. This was pointed out in Android issue 2366 --- core/java/android/widget/ListView.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index a786b3f..64e5452 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -3167,11 +3167,12 @@ public class ListView extends AbsListView { /** * Returns the checked state of the specified position. The result is only - * valid if the choice mode has not been set to {@link #CHOICE_MODE_SINGLE} + * valid if the choice mode has been set to {@link #CHOICE_MODE_SINGLE} * or {@link #CHOICE_MODE_MULTIPLE}. * * @param position The item whose checked state to return - * @return The item's checked state + * @return The item's checked state or false if choice mode + * is invalid * * @see #setChoiceMode(int) */ @@ -3185,7 +3186,7 @@ public class ListView extends AbsListView { /** * Returns the currently checked item. The result is only valid if the choice - * mode has not been set to {@link #CHOICE_MODE_SINGLE}. + * mode has been set to {@link #CHOICE_MODE_SINGLE}. * * @return The position of the currently checked item or * {@link #INVALID_POSITION} if nothing is selected @@ -3202,10 +3203,12 @@ public class ListView extends AbsListView { /** * Returns the set of checked items in the list. The result is only valid if - * the choice mode has not been set to {@link #CHOICE_MODE_SINGLE}. + * the choice mode has not been set to {@link #CHOICE_MODE_NONE}. * * @return A SparseBooleanArray which will return true for each call to - * get(int position) where position is a position in the list. + * get(int position) where position is a position in the list, + * or null if the choice mode is set to + * {@link #CHOICE_MODE_NONE}. */ public SparseBooleanArray getCheckedItemPositions() { if (mChoiceMode != CHOICE_MODE_NONE) { -- cgit v1.1