Android 实现Dialog
/* @setTitle 设置对话框标题* @setMessage 设置对话框消息提示*/final AlertDialog.Builder normalDialog = new AlertDialog.Builder(SetActivity.this);normalDialog.setTitle("退出");normalDialog.setMessage("确认要退出登录吗?");...
·

/* @setTitle 设置对话框标题
* @setMessage 设置对话框消息提示
*/
final AlertDialog.Builder normalDialog = new AlertDialog.Builder(SetActivity.this);
normalDialog.setTitle("退出");
normalDialog.setMessage("确认要退出登录吗?");
normalDialog.setPositiveButton("确定",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(SetActivity.this, LoginUserActivity.class);
intent.setFlags(intent.FLAG_ACTIVITY_CLEAR_TASK|intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
});
normalDialog.setNegativeButton("取消",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
// 显示
normalDialog.show();
更多推荐


所有评论(0)