リストビューで何コレクションタイプを使用していますか? 「通常」のコレクションタイプ(たとえばSystem.Collections.Generic.List<T>
)を使用している場合、ListViewの作成後にコレクションに追加するアイテムはListViewに表示されません。代わりにJavaList<T>を使用する必要があります。
Collections binding overviewの末尾に例を参照してください:
// This fails:
var badSource = new List<int> { 1, 2, 3 };
var badAdapter = new ArrayAdapter<int>(context, textViewResourceId, badSource);
badAdapter.Add (4);
if (badSource.Count != 4) // true
throw new InvalidOperationException ("this is thrown");
// this works:
var goodSource = new JavaList<int> { 1, 2, 3 };
var goodAdapter = new ArrayAdapter<int> (context, textViewResourceId, goodSource);
goodAdapter.Add (4);
if (goodSource.Count != 4) // false
throw new InvalidOperaitonException ("should not be reached.");