我有这个类的arrayList:
public class Lawyer extends DbHelper{
private int id;
private String fullName;
private String mobile;
private Context context;
public Lawyer(Context context,int id, String fullName, String mobile) {
super(context);
this.id = id;
this.fullName = fullName;
this.mobile = mobile;
this.context = context;
}
}
我的arrayList 充满了几个人的信息。是否可以在数组列表中填充所有律师的“fullName”?目前,我有这段代码可以用来自简单数组的静态数据填充我的微调器:
String [] items={"Lawyer1","Lawyer2","Lawyer3","Lawyer4","Lawyer5"};
final Spinner lstLawyers;
lstLawyers=(Spinner)findViewById(R.id.lstLawyers);
lstLawyers.setAdapter( new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item,items));
lstLawyers.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
EditText txtMessage = (EditText) findViewById(R.id.txtMessage);
txtMessage.setText(lstLawyers.getSelectedItem().toString());
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});