データベースクエリの結果を入力するテーブルレイアウトがあります。select allを使用すると、クエリは4行のデータを返します。
このコードを使用して、テーブル行内のTextViewにデータを入力します。
Cursor c = null;
c = dh.getAlternative2();
startManagingCursor(c);
// the desired columns to be bound
String[] columns = new String[] {DataHelper.KEY_ALT};
// the XML defined views which the data will be bound to
int[] to = new int[] { R.id.name_entry};
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,
R.layout.list_example_entry, c, columns, to);
this.setListAdapter(mAdapter);
KEY_ALTの4つの異なる値を分離して、それらがどこに行くかを選択できるようにしたいと思います。上記の例の1つではなく、4つの異なるTextViewを設定するようにします。
結果のカーソルを反復処理するにはどうすればよいですか?