您好我想填充一個列表視圖的單元格有3個文本視圖我正在使用數組適配器來做到這一點它沒有第一個textview罰款,但如果我添加更多我得到這個錯誤Android添加多個陣列到TextViews的數組適配器
The constructor ArrayAdapter<String>(Activity, int, int, ArrayList<String>, int, ArrayList<String>) is undefined
有沒有人知道如何做到這一點?
繼承人是我迄今爲止嘗試過我創建的ArrayList和佈局
adapter = new ArrayAdapter<String>(getActivity(),R.layout.document_cell, R.id.name, docNamesArray, R.id.doctype, docTypeArray);
docsList.setAdapter(adapter);
這裏他們匹配相關的觀點是我的佈局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="90dp"
android:background="@color/White"
android:padding="10dp" >
<ImageView
android:id="@+id/docicon"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/docicon"
android:text="Medium Text"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/doctype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/name"
android:layout_toRightOf="@+id/docicon"
android:layout_marginLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/modified"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/docicon"
android:layout_below="@+id/doctype"
android:layout_marginLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
您需要創建自己的ArrayAdapter做到這一點。 –