我已经解决了我的问题,alertDialog.dismiss();
但现在我有一个带有两行对话框的问题。看看什么时候弹出对话框,它只显示这个alertDialog.setMessage("1st line" + System.getProperty("line.separator") + "2nd line");
,我也需要它来显示这个,alertDialog.setMessage("1st line that doesn't display" + System.getProperty("line.separator") + "2nd line that doesn't display");
我真的不明白为什么会这样,所以任何人都可以帮我解决这个问题。
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle("ApplicationTitle");
alertDialog.setIcon(R.drawable.ic_launcher);
alertDialog.setMessage("1st line that doesn't display" + System.getProperty("line.separator") + "2nd line that doesn't display");
alertDialog.setMessage("1st line" + System.getProperty("line.separator") + "2nd line");
alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
alertDialog.show();