read
To set a random color:
<pre class="default prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;">int color;
</pre>
Random rnd = new Random();
color = Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
view.setBackgroundColor(color);
Source