Reputation: 4119
I'm trying to change a color of a button in code as below
btn_no5.setTextColor(0x8E35EF);
the above change is not reflecting(purple color), the text is disappearing after execution of above piece of code. But if i use the color in xml its reflecting. So how to change this through java ?
Upvotes: 0
Views: 289
Reputation: 6037
use like this,
btn_no5.setTextColor(Color.parseColor("#8E35EF"));
Upvotes: 1
Reputation: 98521
The color you are using is fully transparent. Use 0xFF8E35EF instead. The first byte is the alpha (transparency) channel.
Upvotes: 7