I'm writing an android application with java code. The app can support english and italian. Inside the app, there is a spinner that take its values from an enumerate class, the following:
public enum ElementTypesEnum {
MEET("Meet"),
CEREAL("Cereal"),
FISH("Fish"),
OTHER("Other");
private String elementType;
ElementTypesEnum(String elementType) {
this.elementType = elementType;
}
public String getElementType() {
return elementType;
}
}
I want to initialize the values of the enumerate with the values contained in my local string resource file (R.string.value_1). In this class I don't have an instance of the resource file, since I don't have an instance of Context. How can I do this? Thank you in advance, Marco