Chip chip = new Chip(context);
chip.setBackgroundcolor(getResources().getColor(R.color.blue));
The above line gives the error:
java.lang.UnsupportedOperationException: Do not set the background resource; Chip manages its own background drawable.