android - Update Textclock when changing locale -


i'm using textclock widget in app layout. must support different languages, , add dateformat must full date "eeee, dd mmmm yyyy hh:mm:ss a". problem days name , months stays default locale. when change locale programatically not change.

any suggestion? shouldn't handled automatically?

try using public void settextlocale (locale locale):

resources res = context.getresources(); // change locale settings in app. displaymetrics dm = res.getdisplaymetrics(); android.content.res.configuration conf = res.getconfiguration(); conf.locale = new locale(language_code.tolowercase()); yourtextclock.settextlocale(conf.locale); res.updateconfiguration(conf, dm); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -