Difference between onItemClickListener and OnItemSelectedListener of AdapterView
What is the difference between these two listeners,documentation says :
OnItemSelectedListener - Interface definition for a callback to be invoked when an item in this view has been selected.
OnItemClickListener - Interface definition for a callback to be invoked when an item in this AdapterView has been clicked.
Selection,Click aren't these equal on touch screen?
OnItemSelectedListener is used for Spinners, and OnItemClickListener is used for ListViews.
AdapterView.OnItemSelectedListener is invoked only when the newly selected position is different from the previously selected position or if there was no selected item.
However AdapterView.OnClickListener is invoked even you click the same item everytime.
http://developer.android.com/reference/android/widget/AdapterView.OnItemSelectedListener.html
Android makes a distinction between selection events and click events. Widgets based off of the “spinner” paradigm — including Spinner and Gallery — treat everything as selection events. Other widgets — like ListView and GridView — treat selection events and click events differently. For these widgets, selection events are driven by the pointing device, such as using arrow keys to move a highlight bar up and down a list. Click events are when the user either “clicks” the pointing device (e.g., presses the center D-pad button) or taps on something in the widget using the touchscreen.
(source: Excerpt from "The Busy Coder's Guide to Android Development" Version 3.8)