1

I am using fragments to display a panel with two choices, A and B. When the user clicks on a choice, I would like to highlight the individual choice.

In onActivityCreated:

setListAdapter(new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_activated_1, settingsNames));

By using the .simple_list_item_activated_1, I get exactly what I want. But how to I override the 'blue' highlight color? It sounds simple enough, but I'm having a lot of trouble.

I've tried it in a roundabout way, but it doesn't select the first item, when the activity is first created. I've tried to make it a 'button' and set drawable when pressed, but didn't work. So, is there a simple way to override the default android styles?

Thank you so much.

Cindy
  • 11
  • 1
  • You just need a selector, see here: http://stackoverflow.com/questions/4051297/how-do-i-style-selected-item-in-android-listview – michaelg Jul 18 '11 at 23:31

0 Answers0