I have a Theme in my Application which defines default textappearance and Button Style.
<style name="AppTheme" parent="@android:style/Theme.Light.NoTitleBar.Fullscreen">
<item name="android:textAppearance">@style/TextAppearance.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance.Large</item>
<item name="android:textAppearanceMedium">@style/TextAppearance.Small</item>
<item name="android:textAppearanceSmall">@style/TextAppearance.Medium</item>
<item name="android:textColorPrimary">#000000</item>
<item name="android:textColorSecondary">#000000</item>
<item name="android:textColorTertiary">#000000</item>
<item name="android:buttonStyle">@style/Button</item>
</style>
<style name="TextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textColorHint">?android:attr/textColorHint</item>
</style>
<style name="TextAppearance.Large">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textSize">32dp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textSize">22dp</item>
</style>
<style name="TextAppearance.Small">
<item name="android:textColor">?android:attr/textColorTertiary</item>
<item name="android:textSize">18dp</item>
</style>
<style name="Button" parent="@android:style/Widget.Button">
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textColorHint">?android:attr/textColorHint</item>
<item name="android:textStyle">normal</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
</style>
When I create a RadioButton using
RadioButton radioButton = new RadioButton(this, null, R.style.AppTheme);
The RadioButton is created and the text is styled properly but the checked marker disappears. Why?
I have the Radiobutton in a Buttongroup, where I dynamically add the buttons. When I add a Button via the layout the marker is displayed properly. But the dynamically added buttons don't.