Here's the problem: When I have an activity running in the background, and I switch locales, and I switch back to the application, everything updates... EXCEPT checkboxes and radio buttons that have an "android:id" attribute set.
If the checkboxes and radio buttons don't have the "android:id" attribute, then they update OK. Other fields don't have this problem, whether they have an "android:id" attribute or not.
What is the best way to make sure everything in my running activity is updated whenever the locale is changed?
Steps to reproduce:
1) Create a "Hello, Android" project in Eclipse. 2) In the main layout, define two checkboxes:
<CheckBox android:text="@string/checkbox" android:id="@+id/CheckBox01" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
<CheckBox android:text="@string/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
3) Create two strings.xml: one under "values" and one under "values-es".
4) Create the following string under "values":
<string name="checkbox">English</string>
5) Create the following string under "values-es"
<string name="checkbox">español</string>
6) Set device to “English”
7) Run the application on the emulator or any device (tested on HTC G1).
8) Observe. Both checkboxes say “English”.
9) Press “Home” to return to the menu and leave the application running in the background.
10) Go to the settings. Switch the language to “español"
11) Press and hold “Home”. Return to the application.
Expected result:
Both checkboxes say “español”
Actual result:
First checkbox says “English”
Second checkbox says “español”
It appears that the checkbox with an “android:id” attribute is not updating as it should. The checkbox without the “android:id” attribute is working as expected.