喜的朋友我設定是一個對話框,沒有按鈕,但只有NO是可見的是按鈕是不可見的,請建議我'是'按鈕不顯示在Android應用程序的確認框中?
這是我事先用感謝
alertDialog.setButton("YES", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int which) {
// Write your code here to invoke YES event
Toast.makeText(getApplicationContext(), "You clicked on YES", Toast.LENGTH_SHORT).show();
}
});
// Setting Negative "NO" Button
alertDialog.setButton("NO bad", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Write your code here to invoke NO event
Toast.makeText(getApplicationContext(), "You clicked on NO", Toast.LENGTH_SHORT).show();
dialog.cancel();
}
});
如果這實際上是一個AlertDialog,請使用正負按鈕。 – CommonsWare
它顯示錯誤,如果我使用正面和負面 – Vji
它顯示什麼錯誤? – Piyush