AlertDialog

AlertDialog.Builder builder=new  AlertDialog.Builder(MainActivity.this);
                builder.setIcon(R.mipmap.ic_launcher);
                builder.setTitle("选择一个");
                data=new String[]{"szu","zqx","children"};
                builder.setItems(data, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Log.d("MainActivity",data[which]);
                        alertDialog.dismiss();
                    }
                });
                builder.setCancelable(false);
                alertDialog=builder.create();
                alertDialog.show();

 

posted @ 2016-06-01 11:18  zqxLonely  阅读(125)  评论(0编辑  收藏  举报