I have this code:
package lijap.app.starcraft2counters;
import java.io.File;
import android.app.Activity;
import android.os.Bundle;
import android.os.Enviro
Check this one
yearDropdown.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView> parentView, View selectedItemView, int position, long id)
{
selectedyear = parentView.getSelectedItemPosition();
drpyear = yearDropdown.getSelectedItem().toString();
//your code here
}
public void onNothingSelected(AdapterView> parentView)
{
selectedyear = 0;
//return;
}
});
monthDropdown.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView> parentView, View selectedItemView, int position, long id)
{
//your code here
}
public void onNothingSelected(AdapterView> parentView)
{
selectedmonth = 0;
//return;
}
});
dayDropdown.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView> parentView, View selectedItemView, int position, long id)
{
//your code here
}
public void onNothingSelected(AdapterView> parentView)
{
selectedday = 0;
}
});
you need to create each adapter for every spinner.
adapterYear = new ArrayAdapter(this,android.R.layout.simple_spinner_item);
yearDropdown.setAdapter(adapterYear);
adapterMonth = new ArrayAdapter(this,android.R.layout.simple_spinner_item);
monthDropdown.setAdapter(adapterMonth);
adapterDays = new ArrayAdapter(this,android.R.layout.simple_spinner_item);
dayDropdown.setAdapter(adapterDays);