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

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - @PluginTarget(Node.class) not registering as neo4j plugin -

python - Calculate STD manually using Groupby Pandas DataFrame -