Skip to content Skip to sidebar Skip to footer

Make Whole Line In A Listview Clickable?

I have some problems with my ListView. At fist I build my project for android v2.2. No I build the same one in v2.1. My Problem is now, that in my listview no longer the whole line

Solution 1:

You can do something like this...

override the getview of the simple adapter like shown in this link.

In the adapter..

View getView(......)
{
    // set the tag of the text view object
    textView.setTag(data);
    textView.setOnClickListner(myOnClick);

}

Member on click listener.

publicOnClickmyOnClick=newOnclick(

    voidonclick(View v)
    {
        Objectdata= view.getTag();
        // do something based on the data..
    }

);

I hope it helps...

Post a Comment for "Make Whole Line In A Listview Clickable?"