Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set a values folder for multiple android sdk versions

Tags:

android

styles

I would like to set a values folder for multiple sdk verions to set a theme for everything under sdk 19. I have tried doing:

protected void onCreate(Bundle savedInstanceState) {
        if (Build.VERSION.SDK_INT < 19) {
            getApplication().setTheme(R.style.HomeTheme4);
        }
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main_launch_screen);
[.....]
}

But this doesnt seem to set the theme For the whole app.

Thank you in advance.

like image 836
Sam Panagrosso Avatar asked Mar 26 '26 13:03

Sam Panagrosso


1 Answers

you could place your theme that you want to use for API-19 and above inside the folder:

/values-v19

and the default values folder then will handle everything below API-19:

/values

see related android resource qualifiers documentation.

like image 193
donfuxx Avatar answered Mar 29 '26 03:03

donfuxx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!