dialog

AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("标题");
builder.setMessage("是否要做什么?");
builder.setPositiveButton("是", new DialogInterface.OnClickListener() {
	@Override
	public void onClick(DialogInterface arg0, int arg1) {
	}
});
builder.setNegativeButton("否", new DialogInterface.OnClickListener() {
	@Override
	public void onClick(DialogInterface dialog, int which) {
	}
});
AlertDialog dialog = builder.create();
dialog.setCanceledOnTouchOutside(true);
dialog.show();
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("正在执行");
LayoutInflater inflater = LayoutInflater.from(MainActivity.this);
View view = inflater.inflate(R.layout.mylayout, null);
mProgress = (ProgressBar) view.findViewById(R.id.myprogressbar);
builder.setView(view);
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
	@Override
	public void onClick(DialogInterface dialog, int which) {
		
	}
});
builder.setCanceledOnTouchOutside(true); 
builder.show();


阅读更多

没有更多推荐了,返回首页