I have been racking my brain trying to get this to work. I want to dynamically enter in years from 1900 to the current year into a spinner. I don\'t think that this is possible
You're very close. Try this:
ArrayList years = new ArrayList();
int thisYear = Calendar.getInstance().get(Calendar.YEAR);
for (int i = 1900; i <= thisYear; i++) {
years.add(Integer.toString(i));
}
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, years);
Spinner spinYear = (Spinner)findViewById(R.id.yearspin);
spinYear.setAdapter(adapter);
You just forgot to add
spinYear.setAdapter(adapter);