I need to use a HTML color code I have in my app.
I am using:
ProgressBar downloadProgressBar = (ProgressBar) findViewById(R.id.downloadprogress);
downloadProgressBar.getIndeterminateDrawable().setColorFilter(
0xFFFF0000,
android.graphics.PorterDuff.Mode.MULTIPLY
);
I need to convert a HTML colour code to the format above (like 0xFFFF0000.)
How do I do that? Or is there another solution for using a HTML color code with the above code?
ProgressBar downloadProgressBar = (ProgressBar)findViewById(R.id.downloadprogress);
downloadProgressBar.getIndeterminateDrawable().setColorFilter(Color.parseColor("#FFFF0000"),android.graphics.PorterDuff.Mode.MULTIPLY);
I think it will help you.
Thank you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With