Yes, you can have multiple spinner's that can be managed by single listener or you can have seperate Listener for each.
For Single Listener you can do something like this,
Set the Listener
spinner1.setOnItemSelectedListener(this);
spinner2.setOnItemSelectedListener(this);
Then you can use onItemSelected
to get perform the action related to the spinner's.
@Override
public void onItemSelected(AdapterView<?> parent, View view,
int position,long arg3)
{
int id = parent.getId();
switch (id)
{
case R.id.spinner1:
// your stuff here
break;
case R.id.spinner2:
// your stuff here
break;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…