I've developed a app which supports two languages English (en) & Spanish (es), to support multilingual I followed developer.android's link http://developer.android.com/training/basics/supporting-devices/languages.html I've put Spanish images in drawable folders drawable-es-rES-hdpi, drawable-es-rES-ldpi, drawable-es-rES-mdpi and all spanish related text to strings.xml in values-es folder.
When I changed the language from English to Spanish from my App's settings then it changes all text from english to spanish are working correctly however app is not fetching the images from spanish drawable folders (This issue occurs for HDPI device & all text, images change are working fine on MDPI device's like Samsung Galaxy ACE (Res : 320 X 480)).
I am facing this issue on device Google Nexus with OS 4.1.2, Resolution 480 X 800.
Does anybody had faced such kind of problem? Please help me.
Finally I got the solution.
I was creating local object only with language, up to gingerbread it changes all text & images for english <-> spanish, however it not changes images on jelly bean : My old Local object for both english & spanish language :
Locale locale2 = new Locale(appLanguageStr)
working Local object
Locale locale2 = new Locale(appLanguageStr, countrycode);
This one is final method that works for me on both Gingerbread & Jelly Bean :
public void updateAppsLanguage(String appLanguageStr)
{
Locale locale2 = null;
if(appLanguageStr.equalsIgnoreCase("English"))
{
appLanguageStr = "en";
locale2 = new Locale(appLanguageStr);
}
else if(appLanguageStr.equalsIgnoreCase("Spanish"))
{
appLanguageStr = "es";
locale2 = new Locale(appLanguageStr, "esp");
}
Locale.setDefault(locale2);
Configuration config2 = new Configuration();
config2.locale = locale2;
getBaseContext().getResources().updateConfiguration(config2, getBaseContext().getResources().getDisplayMetrics());
//Refresh the current page
finish();
Intent intent = new Intent(this,AppSetting.class);
startActivity(intent);
}