i'm having problem if open android app , go system settings change language , open app again, strings in app won't translated unless app force quit , relaunched. idea why happens? don't have android:configchanges
set "locale"
anywhere in androidmanifest
, doesn't mean activities should restarted on own?
i had issue.i used code below posted in stackoverflow answer , changed language without refreshing activity
public void setlocale(string lang) { mylocale = new locale(lang); resources res = getresources(); displaymetrics dm = res.getdisplaymetrics(); configuration conf = res.getconfiguration(); conf.locale = mylocale; res.updateconfiguration(conf, dm); onconfigurationchanged(conf); } @override public void onconfigurationchanged(configuration newconfig) { // refresh views here lbllang.settext(r.string.langselection); super.onconfigurationchanged(newconfig); }
i hope you.......
Comments
Post a Comment