I'm relatively new to Java and I'm trying to create a dataHandler for an xml. But I get an error: "The method getResources() is undefined for the type CasusHandler".
What am I forgetting?
import android.content.res.Resources;
public class CasusHandler {
public String[] casus;
public void setCasusArray() {
Resources res = getResources();
this.casus = res.getStringArray(R.array.casus);
}
public String[] getCasusArray() {
return this.casus;
}
}
getResources()
is a method ofContext
. and here you can pass theContext
reference to the methodsetCasusArray()