我已经编写了从数据库中获取结果的代码,该数据库已成功绑定到列表视图。但是现在我想要自定义对话框格式的列表视图。意味着列表数据应该出现在对话框中。如何将列表数据附加到自定义对话框?
final Cursor cursor = dbHelper.fetchAllRecords();
String[] columns = new String[] {
RecordsDbAdapter.KEY_NAME,
RecordsDbAdapter.KEY_BIRTHDAY,
};
int[] to = new int[] {
R.id.name,
R.id.birthdate,
};
dataAdapter = new SimpleCursorAdapter(
this, R.layout.row,
cursor,
columns,
to);
ListView listView = (ListView) findViewById(R.id.list);
listView.setAdapter(dataAdapter);