android - how to refresh layout when i press a button -


When I press a button to change a new language from the new string value but the layout is not changed, how do I Can i do This is my code:

  btnChangeLng.setOnClickListener (see the new OnClickListener () {@Override click on Public Zero (see V) {string language = "lo"; locale locale = new locale (Language); Locale.setDefault (Locale); Resource Resources = getBaseContext (). GetResources (); DisplayMetrics displayMetrics = resources.getDisplayMetrics (); Configuration Configuration = resources.getConfiguration (); configuration.locale = locale; resources.updateConfiguration ( Configuration, display metrics); Toast. Maketext (Main_activity.es, "Laos", Toast. LNNHTLOS ). To show (); // refresh}});  

When I open this app again, languages ​​will change, but when I press a button, I can not make any changes, now I want to refresh my layout.

Have you tried to localize this Android? You can refresh your current activity.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -