Reputation: 499
Other than using listeners, is there any way by which i can get index of an item in the list?
Upvotes: 0
Views: 1001
Reputation: 1227
If you are using 'getCheckedItemPosition' dont forget to set the choice mode to single in order to ensure only one item can be selected at a time. ie via
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
And to answer your question : yes , this can be used without a listener.
Upvotes: 2
Reputation: 284786
Perhaps you mean ListView, in which case you may want getCheckedItemPosition
.
Upvotes: 1