Android : what is parent and view in onItemClick?

on Sunday, September 14, 2014


I have a difficulty in understanding following method. In the documentation, the method description is as follows:



public abstract void onItemClick (AdapterView<?> parent, View view, int position, long id)


Parameters:
parent The AdapterView where the click happened.
view The view within the AdapterView that was clicked (this will be a view provided by the adapter)
position The position of the view in the adapter.
id The row id of the item that was clicked.


I understand last two, but couldn't understand what parent does here and why view is required?


if someone have a good explanation, then please let me understand.


0 comments:

Post a Comment