How can I add a third button to an Android Alert Dialog?
问题 The API says that the Alert Dialog can have one, two or three buttons, but the SDK only allows for a positive and negative button. How then can I add a third button? 回答1: This code snippet should help explain the three different buttons you can use: alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle("Dialog Button"); alertDialog.setMessage("This is a three-button dialog!"); alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Button 1 Text", new DialogInterface