Question

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?

Was it helpful?

Solution

OnItemSelectedListener is used for Spinners, and OnItemClickListener is used for ListViews.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top