Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Change splash screen based on language

I have an app with different splash screen.. One for italian language and one for the english one. How can I set my app to choose the correct image based on system language?

like image 932
darkmax Avatar asked Dec 12 '25 13:12

darkmax


2 Answers

You can put different drawables and layouts in different resource directories such as:

res/drawable-en/
res/drawable-it/
res/layout-en/
res/layout-it/

en for english and it for italian. It might be best to keep the "default" resources in the standard directories with no language specifier.

If you name the actual files inside those directories as the same name, then the system will automatically pick the correct file depending on the users locale.

See Android Docs for more information.

like image 175
Tom Leese Avatar answered Dec 15 '25 03:12

Tom Leese


http://developer.android.com/training/basics/supporting-devices/languages.html

you can use multiple resource folders and it will load images based on device locale/config

having the folders with prefix will automatically detect/load for local

eg

res/layout-en/
res/layout-it/
like image 27
IanO.S. Avatar answered Dec 15 '25 03:12

IanO.S.



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!