带确定和取消的

AlertDialog alertDialog = new AlertDialog.Builder(activity)
.setMessage(R.string.confirm_investment)
.setPositiveButton(R.string.button_confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
})
.setNegativeButton(R.string.cancel,null).show();
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(activity.getResources().getColor(R.color.blue));
alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(activity.getResources().getColor(R.color.btn_color1));

你可能感兴趣的:(android,android)