CopyPastor

Detecting plagiarism made easy.

Score: 0.8464399483721694; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-04-15
by mohammadReza Abiri

Original Post

Original - Posted on 2015-07-26
by Rishad Appat



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Try this code to change the language...
Locale locale = new Locale("ar"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); settings.edit().putString("locale", "ar").commit(); this.finish(); Intent refresh = new Intent(this, MainActivity.class); startActivity(refresh); And in each activity's onCreate and Onresume Methods you have to do somthing like this..
if (settings.getString("locale","").equals("en")) { Locale locale = new Locale("en"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); settings.edit().putString("locale", "en").commit(); }
Try this code to change the language...
Locale locale = new Locale("ar"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); settings.edit().putString("locale", "ar").commit(); this.finish(); Intent refresh = new Intent(this, MainActivity.class); startActivity(refresh);
And in each activity's onCreate and Onresume Methods you have to do somthing like this..
if (settings.getString("locale","").equals("en")) { Locale locale = new Locale("en"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); settings.edit().putString("locale", "en").commit(); }

        
Present in both answers; Present only in the new answer; Present only in the old answer;