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