2

I need to change the background of the item in the list view to the color which appears when we press the item (kind of transparent yellow color).

Currently i am doing like this:

v.setBackgroundColor(Color.BLUE);

But instead of this blue color I need to set the background to that transparent yellow kind of color which flashes and goes when we touch the item.

What is the color code for that? Forgive me if the question is irrelevant.

Name is Nilay
  • 2,743
  • 4
  • 35
  • 77
roy mathew
  • 7,782
  • 4
  • 29
  • 40
  • see below link http://stackoverflow.com/questions/2217753/changing-background-color-of-listview-items-on-android – Rishi Feb 09 '12 at 12:48

1 Answers1

1

Actually its not a color. Its 9-patch drawable.

If you don't provide any color, so the default (yellow one) should be visible.

Otherwise you may download the 9-patch list_selector_background_focus.9 from here and sue it in your list when an item is pressed.

For more reference, view this

waqaslam
  • 67,549
  • 16
  • 165
  • 178