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
This commit is contained in:
Kenny Root
2009-06-09 12:07:28 -05:00
parent 9b90fd4fa1
commit 158c19020b

View File

@@ -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 <code>false</code> 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 <code>null</code> if the choice mode is set to
* {@link #CHOICE_MODE_NONE}.
*/
public SparseBooleanArray getCheckedItemPositions() {
if (mChoiceMode != CHOICE_MODE_NONE) {