<pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);
Dialog dialog = builder.create();
// show函数需要在getWindow前调用
dialog.show();
// 对话框窗口设置布局文件
Window window = dialog.getWindow();
window.setContentView(R.layout.res);
// 获取对话窗口中的ListView
ListView list_record = (ListView) window.findViewById(R.id.someView);