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
Post a Comment