Skip to content

Instantly share code, notes, and snippets.

View aldakur's full-sized avatar
💭
Teaching & learning

Egoitz Gonzalez aldakur

💭
Teaching & learning
View GitHub Profile
@gunhansancar
gunhansancar / LocaleHelper.java
Last active April 8, 2021 12:34
While developing your awesome application, sometimes you are required to add a language change feature to your app on the fly. However, Android OS does not directly support this behaviour. And therefore, you need to solve this situation in some other ways. For more details see http://gunhansancar.com/change-language-programmatically-in-android/
package com.gunhansancar.changelanguageexample.helper;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.preference.PreferenceManager;