I haven't tried this myself, so this is more an idea than a solution, but probably worth trying. Class UnderlineSpan
has method updateDrawState
, which takes TextPaint
as a parameter. In turn, TextPain can has field public int linkColor
.
So for you it would be something like
TextPaint tp = new TextPaint();
tp.linkColor = [your color]; //not quite sure what the format should be
UnderlineSpan us = new UnderlineSpan();
us.updateDrawState(tp);
SpannableString content = new SpannableString("Ack:");
content.setSpan(us, 0, content.length(), 0); tvAck.setText(content);
Reference for both TextPaint
and UnderlineSpan
are very poor, with majority of javadoc missing altogether (judge for yourself: http://developer.android.com/reference/android/text/TextPaint.html), so I'm not certain how to use these though.