我有一个带有SimpleCursorAdapter的列表,这个列表是用arraylist制作的,问题是我想在列表中只添加具有“persoane.proprietar ==”no“的数组的值,这是我的代码详细信息
private class ImageAndTextAdapter extends SimpleCursorAdapter {
private Context adContext;
public int getCount() {
persNu = persPropNu();
return persNu;
}
public ImageAndTextAdapter(Context context, int layout, Cursor c,
String[] from, int[] to) {
super(context, layout, c, from, to);
this.adContext = context;
}
public View getView(int pos, View inView, ViewGroup parent) {
View v = inView;
if (v == null) {
LayoutInflater inflater = (LayoutInflater) adContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = inflater.inflate(R.layout.element_lista_items, null);
}
if (GetObiecte.persoane.get(pos).proprietar.equals("no"))//if put this line in the list will be a blank line if the propriety isn't no,and I don't need it
((TextView) v.findViewById(R.id.textListTopElem)).setText(GetObiecte.persoane.get (pos).nume);
((TextView) v.findViewById(R.id.textListElem)).setText(GetObiecte.persoane.get (pos).judet);
if (GetObiecte.persoane.get(pos).tipPersoana.equals("fizica")){((ImageView) v.findViewById(R.id.imgListElem)).setImageResource(R.drawable.icon_foto_person);}
else {((ImageView) v.findViewById(R.id.imgListElem)).setImageResource(R.drawable.icon_foto_person_pj);}
return v;
}
}