2012-12-18 8 views
0

나는 SimpleCursorAdapter를 가진 목록을 가지고 있는데,이 목록은 arraylist로 만들어졌고, 문제는 내가 목록에 "persoane.proprietar =="가없는 배열의 값만 추가하려고한다는 것이다. 이 값이 변경되지 않은 경우 "이 동적으로 다음 어댑터에만 관련 항목을 보내 자세한 내용안드로이드 간단한 커서 어댑터

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; 
    } 
} 

답변

0

내 코드입니다.

in this question

설명처럼 동적 필터를 사용하여 변경되는 경우
관련 문제