ArrayList<DataCCHeading>CC1=new ArrayList<DataCCHeading>();
ArrayList<DataCCHeading>CC2=new ArrayList<DataCCHeading>();
ArrayList<DataCCHeading>hd=new ArrayList<DataCCHeading>(result);
for (DataCCHeading dataCCHeading : hd) {
if(dataCCHeading.Ownername==TAG_CC1HeadingData){
CC1.add(dataCCHeading);
}
else if(dataCCHeading.Ownername==TAG_CC2HeadingData){
CC2.add(dataCCHeading);
}
}
ArrayAdapter<DataCCHeading>adaptercc1=new ArrayAdapter<DataCCHeading>(TimeClockDashBoard.this,android.R.layout.simple_spinner_item,CC1);
adaptercc1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
myCC1Spinner.setAdapter(adaptercc1);
ArrayAdapter<DataCCHeading>adaptercc2=new ArrayAdapter<DataCCHeading>(TimeClockDashBoard.this,android.R.layout.simple_spinner_item,CC2);
adaptercc2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
myCC2spinner.setAdapter(adaptercc2);
数据不显示... DataCCHeading 是类...
public class DataCCHeading {
String Code;
String Description;
String Ownername;
public DataCCHeading(String Code, String Description,String owner) {
this.Code = Code;
this.Description = Description;
this.Ownername=owner;
}
public String toString() {
return Description;
}
public String getId() {
return Code;
}
public String GetDescription() {
return Description;
}
public String Ownername()
{
return Ownername;
}
}
我只想在微调器中显示描述。Spinner 不显示任何数据。请指导我。