The ic_menu_info icon is properly displayed in the xml menu item that calls it but not in this AlertDialog.
new AlertDialog.Builder(this).setMessage(menuInfo).setNeutralButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int i) {
// do nothing – it will close on its own
}
})
.setIcon(R.drawable.ic_menu_info).show();
...
To set the action on alert dialog call the setPositiveButton(), setNeutralButton() and setNegativeButton() methods for positive, neutral and negative action respectively. The show() method of AlertDialog. Builder is used to display the alert dialog.
AlertDialog. A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.
AlertDialog is a lightweight version of a Dialog. This is supposed to deal with INFORMATIVE matters only, That's the reason why complex interactions with the user are limited. Dialog on the other hand is able to do even more complex things .
Needed a .setTitle()
since that is where the icon wants to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With