Reputation: 249
what is the difference between onClickListener and onItemClickListener in Android ListViews ? And what are the different implementations of these ?
Upvotes: 7
Views: 7006
Reputation: 9915
ListView has an Item Click listener for each row of the listview but the onClickListener is for the whole listview no matter which ever row you click the onClick and onItemClickListener is called but the values that come with each method are different.
OnItemClickListener you can use for lets say going to a particular activity when a particular row is touched.
OnClickListener you can check if the listview has received a touch by the user so do you want to refresh the list? or change the scrollbar's view or do something with the listview as a whole unit.
Upvotes: 20