There is difference.
When click on List Item(onListItemClick), The parameter of that handler has
information about list item that clicked.When click on List view control(
onItemClick), The parameter of that handler has information about list view
control that clicked.Please check following syntax.
 protected void onListItemClick
(ListView<http://developer.android.com/reference/android/widget/ListView.html>l,
View <http://developer.android.com/reference/android/view/View.html> v, int
position, long id)
Since: API Level
1<http://developer.android.com/guide/appendix/api-levels.html#level1>

This method will be called when an item in the list is selected. Subclasses
should override. Subclasses can call
getListView().getItemAtPosition(position) if they need to access the data
associated with the selected item.
Parameters l The ListView where the click happened  v The view that was
clicked within the ListView  position The position of the view in the list  id
The row id of the item that was clicked




 public abstract void onItemClick
(AdapterView<http://developer.android.com/reference/android/widget/AdapterView.html><?>
parent, View 
<http://developer.android.com/reference/android/view/View.html>view,
int position, long id)
Since: API Level
1<http://developer.android.com/guide/appendix/api-levels.html#level1>

Callback method to be invoked when an item in this AdapterView has been
clicked.

Implementers can call getItemAtPosition(position) if they need to access the
data associated with the selected item.
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.

Thanks & Regards
Ramaraju

On Fri, Sep 3, 2010 at 10:58 AM, Sohan badaya <[email protected]>wrote:

> Hi,
>
> I didn't get where i should use which method between these two.
> I think these two works same. But then why they have provided same
> functionality with two methods.
>  If anyone have good link for better understanding please let me know.
>
> Thanks,
> Sohan Badaya
>
>
>
> On Fri, Sep 3, 2010 at 1:05 AM, TreKing <[email protected]> wrote:
>
>> On Thu, Sep 2, 2010 at 9:54 AM, Sohan badaya <[email protected]>wrote:
>>
>>> I am confused with two below method
>>
>>
>> Why are you confused ... ?
>>
>>
>> -------------------------------------------------------------------------------------------------
>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
>> transit tracking app for Android-powered devices
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<android-developers%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to