android - Force app to read from layout-ar -


i asking if there way force android application read arabic layout folders , arabic values folder whatever device language ?

you can force different locale this:

protected static void setlocale(final context ctx, final string lang) {     final locale loc = new locale(lang);     locale.setdefault(loc);     final configuration cfg = new configuration();     cfg.locale = loc;     ctx.getresources().updateconfiguration(cfg, null); } 

in case, use so

setlocale(getapplicationcontext(), "ar") 

this take values "ar" folders (drawables-ar, values-ar, layout-ar, ...)


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -