私はチェックボックスの助けを借りて複数の選択肢でカスタマイズリストを作成しています。最後に、リストの項目選択のイベントで選択されたチェックボックスを設定することができました。androidのカスタムリストビュー
しかし、チェックボックスがリストの選択に従って選択されていない場合 最初の行をクリックすると、4行目のチェックボックスが自動的にクリックされます。短いシーケンスでは維持されません。 コード私が働いているとは、など
ListAdapter adapter = new SimpleAdapter(
this,
Datalist ,
R.layout.customlist,
new String[] {"fileName","contentLength","keyPath"},
new int[] {R.id.title,R.id.size, R.id.path}
);
setListAdapter(adapter);
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
ViewGroup group=(ViewGroup)v;
CheckBox check=(CheckBox)group.findViewById(R.id.sharecheckbox);
check.toggle();
}
http://stackoverflow.com/questions/7738527/getting-an-issue-while-checking-the-dynamically-generated-checkbox-through-list/7739006#7739006 – MKJParekh
ここにこのチュートリアルをチェックカスタマイズされたリストの良い例を考えてみましょう。 [http://www.vogella.de/articles/AndroidListView/article.html] (http://www.vogella.de/articles/AndroidListView/article.html) – Pratik