Java tutorial
//package com.java2s; import android.graphics.Color; public class Main { public static int generateRandomColor() { int randomColor = Color.argb(0xFF, getRandomNum(), getRandomNum(), getRandomNum()); return randomColor; } private static int getRandomNum() { return (int) (Math.random() * 0xFF); } }