Selected items in a listview are in the selected state, not in the
focused state. You can use state drawables to achieve this.

On Thu, Jan 21, 2010 at 2:47 PM, Mark Nuetzmann
<mark.nuetzm...@gmail.com> wrote:
> no problem.  so, how do I how do I simply change the color of the text
> for a textview when the item is selected? I obvisouly cannot use a
> focus change listener.  I also cannot add the code to my adpater
> because it is only called when the view is needed and I see no way to
> call onInvalidated() to ask the ListView to repaint the items...
>
> On Jan 21, 4:40 pm, Romain Guy <romain...@android.com> wrote:
>> It's easy: don't use focusableInTouchMode. Especially since ListView
>> already is focusable in touch mode.
>>
>> On Thu, Jan 21, 2010 at 2:31 PM, Mark Nuetzmann
>>
>>
>>
>>
>>
>> <mark.nuetzm...@gmail.com> wrote:
>> > I am completely confused as to how the focusable and
>> > focusableInTouchMode are supposed to work.  If I set
>> > focusableInTouchMode="true" for the items in my ListView the
>> > ItemClickListener is never called.  Why?
>>
>> > I have the selector for the ListView set as a rect shape filled with a
>> > solid color.  As I scroll through the items in the list or touch one
>> > of the items in the list I need to change the color of the text of
>> > some textviews in the row item.  If the item has focus or is selected
>> > I need the text color to be white otherwise I need it to be black.  I
>> > thought it would be a simple matter to create a OnFocusChange listener
>> > that would get called and have it respond based on the hasFocus value
>> > passed in.  This does not work at all.  Is there a "suggested" method
>> > of handling this (what seems to me) simple task?
>>
>> > Regards,
>> > Mark
>>
>> > --
>> > 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
>>
>> --
>> Romain Guy
>> Android framework engineer
>> romain...@android.com
>>
>> Note: please don't send private questions to me, as I don't have time
>> to provide private support.  All such questions should be posted on
>> public forums, where I and others can see and answer them
>
> --
> 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
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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