Solved with this answer How can I get a resource content from a static context?
Today I decided that my app should be available in different languages so I changed every normal string like...:
String hw = "hello world";
..to:
XML:
<string name="hello_world">Hello world!</string>
App:
String hw= getResources().getString(R.string.hello_world);
But for some reason it doesn't show the text anymore. Everthing worked fine when I used the normal methode but now it doesn't. I tried getText() too but this doesn't work neither. I am using the strings to get them into an ArrayList like this:
public hello(){
meineListe.add(hello_world);
Complete class:
public class favorites extends Activity {
static int x = -1;
private ArrayList<String> meineListe = new ArrayList<String>();
public favorites(){
String a1 = getResources().getString(R.string.a1);
String aa1 = getResources().getString(R.string.aa1);
String aaa1 = getResources().getString(R.string.aaa1);