1) XML side
I want to include many languages in my application which has for default language : english.
So, i read this link which shows how to include several strings.xml files by language in different directory in /values.
My question is simple how to make a reference to these files, for example with a simple strings.xml, if I want to make a reference, i use :
Using xml Syntax Highlighting
- <Button android:id="@+id/ok"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/entry"
- android:layout_alignParentRight="true"
- android:layout_marginLeft="10px"
- android:text="@string/hello_word" />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
But in my case, there are 2 files (for example) in /values-en and /values-es so the current reference (in my code) is deprecated.
2) Java side
Is anybody use ResourceBundle with success?
This code doesn't work :
Using java Syntax Highlighting
- ResourceBundle rb = ResourceBundle.getBundle("myApps/lang/");
- _edit = (TextView) this.findViewById(R.id.label);
- _edit.setText(rb.getString("machin"));
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
I get an MisingResourceException. I think the path is invalide but I don't find the correct sentence.
Thank you in advance






