i use this code for make new radio button and add it to radioGroup
RadioButton buttonh = new RadioButton(getApplicationContext());
RadioGroup.LayoutParams params_rb = new RadioGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
buttonh.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
buttonh.setGravity(Gravity.START);
params_rb.setMargins(0, 0, 12, 0);
buttonh.setTextColor(getResources().getColor(R.color.textColor));
buttonh.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);
buttonh.setText(Html.fromHtml(mscs.get("time_am")));
radiox.addView(buttonh,params_rb);
and its work but its show different color of circle so i must change it to
AppCompatRadioButton buttonh = new AppCompatRadioButton(this);
but when i use this code the circle gone only the text shown any idea ?
also i try to add color to circle but seems there are no circle only text
ColorStateList colorStateList = new ColorStateList(
new int[][]{
new int[]{-android.R.attr.state_checked},
new int[]{android.R.attr.state_checked}
},
new int[]{
Color.DKGRAY
, Color.rgb (242,81,112),
}
);
buttonh.setSupportButtonTintList(colorStateList);