Android examples for Graphics:Color Value
generate Random Color and return int value
//package com.java2s; import android.graphics.Color; public class Main { public static int generateRandomColor() { long black = Long.parseLong("ff000000", 16); long white = Long.parseLong("ffffffff", 16); long colorLong = (long) (Math.random() * (black - white + 1) + white); String colorhex = "#" + Long.toHexString(colorLong); return Color.parseColor(colorhex); }/*from www . java 2 s . com*/ }