2011-11-02 3 views
0

ArrayAdapter의 구현을 액티비티 클래스에서 분리하려고합니다. 지금까지 클래스를 분리하기 위해 이동했지만 getSystemService()가 문제를 일으켰습니다.Android 자신의 ArrayAdapter 구현

I`ve이

public KontaktAdapter(Context context, int textViewResourceId, ArrayList<Kontakt> items) { 
      super(context, textViewResourceId, items); 
      this.context = context; 

처럼 생성자에 컨텍스트를 전달하는 시도했지만 다음 중 어느 것도

LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 

편집 작동하지 않습니다 : 마지막으로이

LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 

답변

0
지금 나를 위해 작동하는 것 같다

시도

LayoutInflater vi = LayoutInflater.from(context); 
관련 문제