First of all, it’s always best to put the code you once made, or at least a representation, if you can’t put the original code.
Anyway, I will assume that you are implementing the Onselecteditemlistener interface in your Activity and passing this instance to your Spinners:
public class MainActivity implements OnItemSelectedListener {
(...)
spinner.setOnItemClickListener(this);
It turns out that this way, you only have a single Switch for 4 Spinners, when in fact you need 4 listeners.
One way to implement these 4 listeners would be:
spinner1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// tratar cliques do Spinner 1
}
});
spinner2.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// tratar cliques do Spinner 2
}
});
spinner3.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// tratar cliques do Spinner 3
}
});
spinner4.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// tratar cliques do Spinner 4
}
});
I had done it and it worked, that was the problem. Thanks friend! :)
– Biscoitinho