在android中询问alertdialog.builder

时间:2013-08-11 16:14:14

标签: android performance

我创建了一个AlertDialog.Builder并为它设置了setItem,我想在onClick()方法中添加一个AlertDialog.Builder:

AlertDialog.Builder dialog_tk = new AlertDialog.Builder(v.getContext());
            dialog_tk.setTitle("Thống kê tổng số sinh viên")
            .setItems(dssinhvien, new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface arg0, int arg1) {
                            // TODO Auto-generated method stub
                            //Toast.makeText(getBaseContext(), dssinhvien[arg1], Toast.LENGTH_SHORT).show();
                            AlertDialog.Builder infomation = new AlertDialog.Builder(getApplicationContext());
                            infomation.setTitle("Thông tin sinh viên "+dssinhvien[arg1])
                            .setMessage(danhsach.getinfo(dssinhvien[arg1]));
                            infomation.create().show();
                        }
                    });
            dialog_tk.create().show();
有人帮我回答“当我在AlertDialog上选择一个项目时,我可以在一个AlertDialog.Builder中创建一个AlertDialog.Builder吗?”我的第二个AlertDialog.Builder有问题:

AlertDialog.Builder infomation = new AlertDialog.Builder(getApplicationContext());

谢谢!

0 个答案:

没有答案