Force language to test Android applications

3

Change the language of the device to test if the application works correctly in different languages, I found the following code in Java

    String languageToLoad  = "en"; // your language
    Locale locale = new Locale(languageToLoad);
    Locale.setDefault(locale);
    Configuration config = new Configuration();
    config.locale = locale;
    getBaseContext().getResources().updateConfiguration(config,
            getBaseContext().getResources().getDisplayMetrics());

Remember to put it in front of the setContentView in OnCreate of the Activity

What other methods do you use to test the applications you do on Android in multi-language support, if you use an emulator?

    
asked by Webserveis 14.01.2016 в 19:40
source

1 answer

2

A very useful method that is usually used directly on the device is to install App Settings , which allows you to use several settings for a particular application, such as changing the default language, its resolution, if used in full screen, etc.

Realemente is a very useful tool to carry out tests without having to alter all your phone.

    
answered by 15.01.2016 / 00:45
source