Skip to content
Stanislav Koshutsky edited this page Feb 15, 2017 · 1 revision

This class is used for applying application locale change on the fly. Like if you have some settings screen in your application where user can change application language. So use setAppLocale to switch Android to other locale, i.e. start using other localized resources.

public static void setAppLocale(Context context, final String languageCode)  

languageCode - ISO code, used to construct a new Locale instance, like if call setAppLocale(ctx,"us") it will construct Locale instance as new Locale("us")

public static void setAppLocale(Context context, final String countryCode, final String languageCode)  

languageCode - ISO code, countryCode - ISO code, used to construct a new Locale instance as new Locale(languageCode,countryCode)

public static void setAppLocale(Context context, final Locale locale2set)  

This method actually applies a given locale for application.

Clone this wiki locally