Which strings.xml did Android choose when my app started up?

141 Views Asked by At

I'm showing an intro screen and would like to show a different image in that intro depending on which strings.xml file is loaded for localization. Is there a way to check which one is loaded? Or is there a way to determine which one Android will pick?

Thanks, Mike

1

There are 1 best solutions below

1
On BEST ANSWER

Android chooses which resource to load depending on the locale of the device which is set inside the Android settings page by the user. To get the currently loaded locale use this.

Locale current = getResources().getConfiguration().locale;

Use this to determine which resource files is loaded. Reade more here.