にカスタムArrayAdapter
セットがありlistView
ます。の各要素内に、listView
作成した .xml に一致するアイテムがあります。以下に示すコード:
listContent.xml
<RelativeLayout
[... some code ommited]
<ImageView
[...]
<TextView
android:id="@+id/listViewText"
[...]
カスタム配列アダプター getView(int 位置、View convertView、ViewGroup 親)
if (position < 4)
{
convertView = inflater.inflate(R.layout.listContent,null);
TextView tv = (TextView) findViewById(R.id.listViewText);
tv.setTextSize(18);
if (position == 0) tv.setText("0");
else if (position == 1) tv.setText("1");
else if (position == 2) tv.setText("2");
else if (position == 3) tv.setText("3");
return convertView;
}
return null;
これを機能させることができないようです。常にエラーが発生します。TextView
listView アイテム内を編集するにはどうすればよいですか?