Android Linkify how to set custom link color?

Edmund Rojas picture Edmund Rojas · Nov 22, 2012 · Viewed 9.9k times · Source

I want to set my android linkify text color to a custom color however mText.setLinkTextColor("#2f6699"); does not work, I have been searching for a built in method that will compile a hexidecimal value but I havent found one, any help will go a long way thanks

Answer

dougcunha picture dougcunha · Nov 22, 2012

You should convert it to a Color. Try:

mText.setLinkTextColor(Color.parseColor("#2f6699"));