What I want is when I load my app up it to randomly have a certain colored background from a predefined list of strings stored in a values xml file called colours.
TRY THIS METHOD SIMPLE AND EASY
private boolean isOne = false, isTwo = false, isThree = false, isFour = false, isFive = false;
if(position==0){
holder.llDate.setBackgroundColor(mContext.getResources().getColor(R.color.color1));
holder.view.setBackgroundColor(mContext.getResources().getColor(R.color.color1));
isTwo = true;
}else if(isOne){
holder.llDate.setBackgroundColor(mContext.getResources().getColor(R.color.color1));
holder.view.setBackgroundColor(mContext.getResources().getColor(R.color.color1));
isOne = false;
isTwo = true;
}else if(isTwo){
holder.llDate.setBackgroundColor(mContext.getResources().getColor(R.color.color2));
holder.view.setBackgroundColor(mContext.getResources().getColor(R.color.color2));
isTwo = false;
isThree = true;
}else if(isThree){
holder.llDate.setBackgroundColor(mContext.getResources().getColor(R.color.color3));
holder.view.setBackgroundColor(mContext.getResources().getColor(R.color.color3));
isThree = false;
isFour = true;
}else if(isFour){
holder.llDate.setBackgroundColor(mContext.getResources().getColor(R.color.color4));
holder.view.setBackgroundColor(mContext.getResources().getColor(R.color.color4));
isFour = false;
isFive = true;
}else if(isFive){
holder.llDate.setBackgroundColor(mContext.getResources().getColor(R.color.color5));
holder.view.setBackgroundColor(mContext.getResources().getColor(R.color.color5));
isFive = false;
isOne = true;
}