I have a list and i write a custom adapter for this. And I want to set some text color for this (e.g. Orange color code #F06D2F). I am presenting the code snippet for my g
This worked for me, and it is simple. First, import "Color"
import android.graphics.Color;
Then all you have to do is this:
text.setTextColor(Color.RED);
Just discovered this today (9/20/13). You can go ahead and declare a variable like this:
private final int ORANGE = 0xFFFF3300;
Then all you have to do is:
text.setTextColor(ORANGE);
Note that the first two hex characters are for opacity ("FF" means opaque). Then, in the example above, the second "FF" is for red, then "33" is for green, and "00" is for blue. Should be possible to create a great many colors this way.
I am pretty new at this Android programming - this is my first post to this forum. Thanks to all of you for your contributions!