我已經寫了代碼,其中我從數據庫中獲得的結果成功綁定到listview。但現在我想在自定義對話框格式中的listview。平均值列表數據應該在dialog.How將listdata附加到自定義對話框?ListView與自定義對話框
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);
http://developer.android.com/guide/topics/ui/dialogs.html#AddingAList –
我已經看到,但我我無法理解如何將我的列表視圖數據添加到自定義Dialogbox.means我在ListView中獲取數據listView =(ListView)findViewById(R.id.list);如何附加它 – user1758835
可能重複[對話框列表視圖和消息](http://stackoverflow.com/questions/6423706/dialog-with-list-view-and-message) –