Wednesday, 15 July 2015

android - Change Language and get resource direction -



android - Change Language and get resource direction -

if alter language,

config.locale = locale; am.updateconfiguration(config);

i read flow code in here http://www.phonesdevelopers.com/1798443/. , see locale define en-us. don't know string of scheme update values-en-rus. define -r? , how scheme select values-en-rus?

try this..

please refer link or sample app here.

get current locale,

string languagetoload = "en"; locale locale = new locale(languagetoload); locale.setdefault(locale); log.i("locale", locale.getdefault());

configuration changes,

configuration config = new configuration(); config.locale = locale; getbasecontext().getresources().updateconfiguration(config, getbasecontext().getresources().getdisplaymetrics());

android

No comments:

Post a Comment