android 弹出AlertDialog的学习案例

我在编写的时候,测试的关键代码:

AlertDialog.Builder builder=new AlertDialog.Builder(MainPointListActivity.this);
                builder.setTitle("弹出标题");
                builder.setIcon(R.drawable.ic_bookmark_black_24dp);
                builder.setCancelable(false);
                builder.setNegativeButton("Negative Button", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        setTitle("点击了Negative按钮");
                    }
                });
                builder.setNeutralButton("Neutra Button",new DialogInterface.OnClickListener(){
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        setTitle("点击了Neutra按钮");
                    }
                });
                builder.setPositiveButton("Positive Button",new DialogInterface.OnClickListener(){
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        setTitle("点击了Positive按钮");
                    }
                });
                builder.show();

 

posted @ 2016-12-27 17:03  kdkler  阅读(314)  评论(0编辑  收藏  举报
我的博客   我的时间线   自定义科技