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();
上一篇:CSS实现透明边框


下一篇:Linux 与 BSD