기본리스트뷰에 아답터를 통해 데이터를 넣어서 출력하는 작업을 하고 있습니다.
전 마지막파라미터인 List<T>에 제가 임이로 만든 Tv 클래스를 갖는 mTvList 을 넣었는데
기본자료형String가 아니어서그런지 오류가 나네요 ㅠㅠ.
----------------------코드-------------------
ArrayList<Tv> mTvList = new ArrayList<Tv>();
Adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mTvList);
---------------------------------------------------
오류내용
"The constructor ArrayAdapter<String>(ListTest, int, ArrayList<ListTest, mTvList);>) is undefined"
위에 <TV>대신에 <String>를 넣으면 잘 됩니다.
구글 레펀런스 정의에는 아래와 같이 되어있습니다.
public ArrayAdapter (Context context, int resource, List<T> objects)
질문)
ArrayAdapter 함수 파라미터로 ArrayList를 넘길때 반드시 String 자료형의 클래스가 와야 되나요?