Question

am working in a multi language Alarm android application with :

  • 1 xml file [alarm_settings.xml]
  • 2 string.xml files [English & arabic]

project files

The problem is that the localization is not working in the right way, below you can find 4 images 2 for my application and 2 for the device's Settings

enter image description here enter image description here enter image description here enter image description here

When you look at these 4 images you can find that in my application the localization works only for the text not for the alignment of views , but you can find in the device's settings that the localization works for both of them - text , views - .

So is it a special case for the device's settings views or i can make my views to be localized like the Device's settings ?!

.java File :

public class MainActivity extends PreferenceActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState); 
    addPreferencesFromResource(R.xml.alarm_settings);
}
} 

thanks

Was it helpful?

Solution

Just found the Solution of the problem at Android Developers Blog

in my case it it was to add

android:supportsRtl="true" 

to the element

application

in

 manifest file.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top