In the following example, How would one access "position" variable from elsewhere (outside the parent class) :
void onItemSelected(AdapterView parent, View view, int position, long id) { Country country = (Country) parent.getAdapter().getItem(position); spinner2.setAdapter(new ArrayAdapter(country.getStates()); }
Thanks.