出於某種原因,我無法使此對話框顯示在屏幕上。它是由一個按鈕按下觸發的,我知道這是可行的,但對話框不會啓動,爲什麼不呢?Android-Alert對話框不起作用
AlertDialog.Builder builder = new AlertDialog.Builder(SummaryActivity.this);
builder.setTitle(R.string.please_confirm)
.setMessage(R.string.terms_details)
.setCancelable(false)
.setPositiveButton(R.string.sign_to_agree, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent DrawIntent = new Intent(getApplicationContext(), DrawingActivity.class);
startActivity(DrawIntent);
}
})
.setNegativeButton(R.string.cancel_button_label, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
結束在哪裏放映()? – kosa 2012-02-08 16:48:09