使用 color.xml下的文件
View1.setBackgroundColor( R.color.blue);
如果不是activity下
listItemView.lay6.setBackgroundColor( context.getResources().getColor(R.color.blue));
//直接使用颜色值
listItemView.lay6.setBackgroundColor( 0xFFf0f0f0);
listItemView.lay6.setBackgroundColor(Color.parseColor("#4a0000"));
listItemView.lay6.setBackgroundColor(Color.rgb(255, 0, 0));