Determining System Locale

If you need to modify application behavior based on locale information, you need to be able to access information about the Android operating system. You can do this by using the getConfiguration() method of the Context object, as follows: Configuration sysConfig = getResources().getConfiguration();

One of the settings available in the Configuration object is the locale: Locale curLocale = sysConfig.locale;

You can use this locale information to vary application behavior programmatically, as needed.

0 0

Post a comment