tags:

views:

42

answers:

2

In android selection dialog, like this example, http://labs.makemachine.net/2010/03/android-multi-selection-dialogs/

How can I specific the color of the text in the dialog? e.g. the color of the text "Mars", "Jupiter"?

A: 

In that case, you will have to create the view of the Dialog manually. Here's an example of how to do that: Creating a Custom Dialog

Cristian
In android, it uses the select_dialog_multichoice.xml file. Which specify android:textColor="@android:color/primary_text_light_disable_only" as the text for the label. Is there any way I can change the color for the theme of my application? Instead of jump thru the loop fo createing custom dialog?
michael
+1  A: 

If you just want to change the text color, just make a duplicate of that select_dialog_multichoice XML layout, title it what you want (e.g select_dialog_multichoice_red.xml), and change the textColor attribute to what you would like instead. Then use this XML file for your adapter, instead of the Android default.

If you are wanting items colored based on variables, you would need to do as Cristian said and create a custom View. Override getView(), and then in there you can set the text color with whatever specific code handles your color choice.

kcoppock
+1 Nice hint... didn't know about it.
Cristian