Double check that getNextRandomColor
is returning something like.-
getResources().getColor(colorResId);
and not just a colorResId
. If that's the case, you could try this.-
prog.setBackgroundColor(getResources().getColor(CommonUtils.getNextRandomColor()));
Anyway, if you're building a multicolor progress bar, you should consider changing the width of a single layout, and using a gradient color.