-1

Im trying to set a random colour in app with AndroidStudio, this is my code:

 } else if (check.equals("random")) {
                display.setTextColor(Color.rgb(184, 134, 011));

How I can do when the user click set random colour? Now is showing 184, 134, 011

thanks!

1 Answers1

0

Try this

Random rnd = new Random(); 
int color = Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));   
display.setTextColor(color);
Fahim
  • 12,198
  • 5
  • 39
  • 57