Custom spinner with object ArrayAdapter can't getResources
问题 I am using the tutorial here to create a custom spinner. When I copy the class CountryAdapter (half-way down the page), eclipse is not able to identify getResources() in myFlag.setBackgroundDrawable(getResources().getDrawable(item.getCountryFlag())); Does anyone know a fix to this problem? Basically, how else might I get the drawable? I am copying the class below public class CountryAdapter extends ArrayAdapter<CountryInfo> { private Activity context; ArrayList<CountryInfo> data = null;