문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top