Maybe it's too late, but I was looking for the same thing, and reading this thread, I came up with a solution to the problem.
You use 256 for alpha, and also 256 for maximum random. but the values ββto use are 0-255. if u change that it will work well.
Random color = new Random(); a.setBackgroundColor(Color.argb(255, color.nextInt(255), color.nextInt(255), color.nextInt(255)));
Greetings
Memme source share