Thanks for the reply , I have tried to add onClickListener to a
ListView but it throws exception to ask me to use onItemClickListener
instead .


I try with onItemClickListener but it does not seems to trigger ... ,
I am using a custom Adapter.

                         mListViewSelection.setOnItemClickListener(new
AdapterView.OnItemClickListener() {

                                @Override
                                public void onItemClick(AdapterView<?> arg0, 
View arg1,
                                                int arg2, long arg3) {

                                        // DO SOMETHING
                                }


                         });


In my custom adapter layout. it contains 1 imageview, 2 textview in a
linearlayout. Focusable & Clickable for imageview and both textview
have been set to "false". Is this the correct way ?



On Jul 27, 3:58 pm, Mark Murphy <[email protected]> wrote:
> Clicking on a list item should be handled by the ListView and should
> take action based upon what item the user clicked. I fear that your
> proposed UI design will be very confusing to users.
>
>
>
> On Tue, Jul 27, 2010 at 3:28 AM, CG <[email protected]> wrote:
> > This should be a simple question because I couldn't get the answer
> > from Google .
>
> > I have  ListView in a LinearLayout .
>
> > I need to handle the click event to allow user click on the
> > LinearLayout to trigger some function.
>
> > I try to add onClickListener to the LinearLayout , and it works only
> > when I click outside of the ListView .
>
> > How do I let the click event on ListView propagate automatically to be
> > handled by the Listener of the LinearLayout ?
>
> > Android 1.6 SDK
>
> > --
> > 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
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 2.9 Available!

-- 
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