0
I need to get the Tostring function to return the size and color separately, as I am filling a spinner with them. A spinner is filled with colors and another with size. However if I put:
public String ToString(){
return cor + tamanho;
}
The two spinner are filled with color and size together...
Object:
public class Cores {
private String cor;
private String tamanho;
public String getTamanho() {
return tamanho;
}
public void setTamanho(String tamanho) {
this.tamanho = tamanho;
}
public String getCor() {
return cor;
}
public void setCor(String cor) {
this.cor = cor;
}
}
The
ToString()
not made for this, create a different method for your specific need, do not use a generic method that should already meet another need.– Maniero
You have to implement an Adapter for each one. No override of the method
getDropDownView()
get and use the field you want to show. Related Custom Spinner showing Resource and non-text– ramaral