44

setBackgroundColor() only takes ints. I don't really know what int equals to what color. Is there a simple way to convert a string like #2222FF on runtime into an int?

Christian
  • 25,249
  • 40
  • 134
  • 225

1 Answers1

114
int color = Color.parseColor("#2222FF");
Konstantin Burov
  • 68,980
  • 16
  • 115
  • 93