Question: I'm using Android Studio. I need to change the color of the Radio Button, after changing the Button Tint Color value to the one I need it works on the preview, but whenever I launch the app on a device the button is the standard green/blue-ish color.

Is this some kind of device API level issue? If so, is it possible to change the color for older devices?

Answer: 
Assuming you are using appcompat in your app just add the below within styles.xml

```
<item name="colorAccent">@color/blue</item>

```

Now blue colorAccent will be set, just change color to any color you want.

For eg, the whole style.xml

```
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/accent_material_dark</item>
        <item name="colorPrimaryDark">@color/accent_color_dark</item>
        <item name="colorAccent">@color/accent_color</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>

```
I have done this way:

**Screenshot**

[![enter image description here](https://i.stack.imgur.com/zkhHP.png)](https://i.stack.imgur.com/zkhHP.png)

**activity\_main.xml**

```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/app_bar_main">

    <RadioGroup
        android:id="@+id/radioGroup"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

    </RadioGroup>

</RelativeLayout>

```

**MainActivity.java**

```
public class MainActivity extends AppCompatActivity
        implements NavigationView.OnNavigationItemSelectedListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radioGroup);

        /**
         * First Radio Buttonn
         */
        RadioButton radioButtonAndroid = (RadioButton) getLayoutInflater().inflate(R.layout.custom_radiobutton, null);
        radioButtonAndroid.setText("Hello Android");
        radioGroup.addView(radioButtonAndroid);

        /**
         * Second Radio Buttonn
         */
        RadioButton radioButtonIos = (RadioButton) getLayoutInflater().inflate(R.layout.custom_radiobutton, null);
        radioButtonIos.setText("Hello Ios");
        radioGroup.addView(radioButtonIos);
    }
}

```

**custom\_radiobutton.xml**

```
<?xml version="1.0" encoding="utf-8"?>
<RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:buttonTint="@color/colorPrimary"
    android:text="">

</RadioButton>

```

Hope this will help you.