I am changing the application locale based on user choice. Independent of device locale.
using
public void setDefaultLocale(Context context, String
for those whom are using Daniel Fekete
's solution which is :
Process exec = Runtime.getRuntime().exec(new String[]{"getprop", "persist.sys.language"});
String locale = new BufferedReader(new InputStreamReader(exec.getInputStream())).readLine();
exec.destroy();
Be aware of that locale might be EMPTY on latest Android Api(+21)! instead of using persist.sys.language
use persist.sys.locale
exec = Runtime.getRuntime().exec(new String[]{"getprop", "persist.sys.locale"});
locale = new BufferedReader(new InputStreamReader(exec.getInputStream())).readLine();
exec.destroy();