//删除和修改
public void ShowAccountBookSelectDialog() {
AlertDialog.Builder _Builder = new AlertDialog.Builder(this);
View _View = GetLayoutInflater().inflate(R.layout.dialog_list, null);
ListView _ListView = (ListView)<span style="color:#ff0000;">_View</span>.findViewById(R.id.myListViewSelect);<span style="color:#ff0000;">//_View这个参数非常重要,如果没有就会在setAdapter()报空指针错误</span>
AdapterAccountBookSelect _AdapterAccountBookSelect = new AdapterAccountBookSelect(this);
_ListView.setAdapter(_AdapterAccountBookSelect);
_Builder.setTitle(R.string.BUttonTextSelectAccountBook)
.setView(_View)
.setNegativeButton(R.string.ButtonTextBack,null);
AlertDialog _AlertDialog = _Builder.create();
_AlertDialog.show();
_ListView.setOnItemClickListener(new OnAccountBookItemClickListene(_AlertDialog));
}
注意:<span style="font-family: Consolas, monospace; letter-spacing: 0.1px; line-height: 15.6px;">BaseAdapter中 如果getCount()方法中返回的数据是0的话,就不会调用getView()的方法了。</span>