AlertDialog不顯示發送按鈕。以下是代碼。請告訴我我在代碼中犯了什麼錯誤。AlertDialog不顯示兩個按鈕
protected Dialog onCreateDialog(int id) {
final AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setMessage("Enter Holla message");
EditText hollaMessage = new EditText(this);
dialog.setView(hollaMessage);
dialog.setCancelable(false);
dialog.setPositiveButton("Send", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
List result = new ArrayList();
}
});
dialog.setPositiveButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dismissDialog(0);
}
});
AlertDialog alert = dialog.create();
return alert;
}
如果我想添加3個按鈕,那麼我該怎麼辦? – jfalexvijay 2011-02-05 06:57:24
問這是一個單獨的問題在stackoverflow和接受答案,如果它可以幫助你在這 – Javanator 2011-02-05 06:58:48
我已經做了很多,但它不起作用。你能幫我嗎? http://stackoverflow.com/questions/15439817/alertdialog-builder-not-displaying-buttons – 2013-03-15 18:40:21