I created RadioButton and CheckBox in LinearLayout programatically. But, now I want to change radio button\'s color and check boxes\'s
You can create dynamic RadioButton like this:
RadioButton male = new RadioButton(ReservationContact.this);
male.setTextColor(Color.BLACK);
male.setText("Male");
male.setSelected(true);
male.setId(0);
This is used for changing default color of circle of RadioButton.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
male.setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(ReservationContact.this, R.color.background)));
}
male.setHighlightColor(getResources().getColor(R.color.background));