Loading api/current.xml +12 −1 Original line number Diff line number Diff line Loading @@ -122838,7 +122838,7 @@ <method name="setOrientation" return="void" abstract="false" native="true" native="false" synchronized="false" static="true" final="false" Loading Loading @@ -150981,6 +150981,17 @@ visibility="public" > </method> <method name="getCheckItemIds" return="long[]" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getCheckedItemPosition" return="int" abstract="false" core/java/android/widget/ListView.java +23 −0 Original line number Diff line number Diff line Loading @@ -3219,6 +3219,29 @@ public class ListView extends AbsListView { return null; } /** * Returns the set of checked items ids. The result is only valid if * the choice mode has not been set to {@link #CHOICE_MODE_SINGLE}. * * @return A new array which contains the id of each checked item in the list. */ public long[] getCheckItemIds() { if (mChoiceMode != CHOICE_MODE_NONE && mCheckStates != null && mAdapter != null) { final SparseBooleanArray states = mCheckStates; final int count = states.size(); final long[] ids = new long[count]; final ListAdapter adapter = mAdapter; for (int i = 0; i < count; i++) { ids[i]= adapter.getItemId(states.keyAt(i)); } return ids; } return new long[0]; } /** * Clear any choices previously set */ Loading Loading
api/current.xml +12 −1 Original line number Diff line number Diff line Loading @@ -122838,7 +122838,7 @@ <method name="setOrientation" return="void" abstract="false" native="true" native="false" synchronized="false" static="true" final="false" Loading Loading @@ -150981,6 +150981,17 @@ visibility="public" > </method> <method name="getCheckItemIds" return="long[]" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getCheckedItemPosition" return="int" abstract="false"
core/java/android/widget/ListView.java +23 −0 Original line number Diff line number Diff line Loading @@ -3219,6 +3219,29 @@ public class ListView extends AbsListView { return null; } /** * Returns the set of checked items ids. The result is only valid if * the choice mode has not been set to {@link #CHOICE_MODE_SINGLE}. * * @return A new array which contains the id of each checked item in the list. */ public long[] getCheckItemIds() { if (mChoiceMode != CHOICE_MODE_NONE && mCheckStates != null && mAdapter != null) { final SparseBooleanArray states = mCheckStates; final int count = states.size(); final long[] ids = new long[count]; final ListAdapter adapter = mAdapter; for (int i = 0; i < count; i++) { ids[i]= adapter.getItemId(states.keyAt(i)); } return ids; } return new long[0]; } /** * Clear any choices previously set */ Loading