Here is a string in my res/values-es/strings.xml
file:
<string name="jcq1">Text text text textttttttttt</string>
Here is where I use it in my java code:
jc.add(new Question("42", "21", "33", "29", 0, getResources().getString(R.string.jcq1), -1));
It is giving me this error:
The method getResources() is undefined for the type Quiz
Where Quiz
is the name of the class where the java code resides. All other example code for the method getResources()
seem to use it the same way I have without problem. What isn't my implementation of it working?
EDIT
public class Quiz {
public Quiz(Context c) {
jc.add(new Question("42", "21", "33", "29", 0, c.getResources().getString(R.string.jcq1), -1));
// 300 other lines pretty much identical to the one above follows...