Skip to content

Instantly share code, notes, and snippets.

Lazy programmer

Jason Liu Jasonlhy

Lazy programmer
Block or report user

Report or block Jasonlhy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Jasonlhy /
Last active Jan 29, 2019
LocaleManager for handling android language switch at runtime
public class LocaleManager {
private static final String LANGUAGE_KEY = "CHOOSE_LANGUAGE";
public static Context setLocale(Context c) {
String savedLanguage = getLanguage(c);
return savedLanguage == null ? c : updateResources(c, savedLanguage);
public static Context setNewLocale(Context c, String language) {
persistLanguage(c, language);
You can’t perform that action at this time.