Mike
Mike

Reputation: 689

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

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

Upvotes: 1

Views: 148

Answers (1)

2hamed
2hamed

Reputation: 9047

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.

Upvotes: 2

Related Questions