- 使用弹出对话框
final AlertDialog.Builder normalDialog =
new AlertDialog.Builder(MainActivity.this);
normalDialog.setIcon(R.drawable.icon_dialog);
normalDialog.setTitle("标题");
normalDialog.setMessage("消息内容");
normalDialog.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//...To-do
}
});
normalDialog.setNegativeButton("取消",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//...To-do
}
});
// 显示对话框
normalDialog.show();
android 8种对话框(Dialog)使用方法汇总
https://www.cnblogs.com/gzdaijie/p/5222191.html
2019年2月28日 星期四
网友评论