Yep.

Make sure that the items (the things returned by your adapter's
getItem(int position) method) contain a boolean that determines
whether one list-item is selected or not. E.g. 'isSelected=true'.

In your list-view' onItemSelected listener, do a
adapter.getItem(position) to get hold of the adapter's data item. Then
set its 'isSelected=true' and then call adapter.notifyDataSetChanged()
(this will cause the adapter's getView method to be called a few
times).

In your adapter's getView(...) method, do a getItem(position), and
examine the data-item's 'isSelected' method. If this is set to true,
make the list-item (convertView) appear selected (e.g. highlight the
background).

On Sep 25, 9:36 am, Kumar Bibek <coomar....@gmail.com> wrote:
> Sure. You can do it in the getView method of the Adapter class.
>
> -Kumar Bibekhttp://techdroid.kbeanie.com
>
> On Sep 25, 11:15 am, Samuh <samuh.va...@gmail.com> wrote:
>
>
>
> > If a data row of my list contains a TextView and a Button, is it
> > possible to format those components individually when the List row is
> > selected? Like change drawable of a Button, font color of the TextView
> > apart from the usual highlighting the background of the List row?
>
> > How can this be achieved?
>
> > Note: A similar question has been asked 
> > here:http://stackoverflow.com/questions/3787695/formatting-listview-row-it...
>
> > Please help.
>
> > Thanks.- Hide quoted text -
>
> - Show quoted text -

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

Reply via email to