Set the Drawable(icon, picture, image) to be used in the title.
Returns: This Builder object to allow for chaining of calls to set methods
1. Create an AlertDialog with Supplied Arguments
2. Set the Title in an AlertDialog.Builder. This must be done, if not, the Icon will not display in the AlertDialog. It will not give an error. It will just not display the image.
3. Add a Drawable to your project.
4. After your AlertDialog.Builder is instantiated in step 1, add the following line to add an icon/drawalbe of the AlertDialog. The line below will add a icon named myicon to the Title of the AlertDialog.
5. Compile and run!
6. Other icons:
Dialog_Time In API Level 10, I had to copy the ic_dialog_time.png file from the API Level 11 default icons to my drawable directory, and used "R.drawable.ic_dialog_time" to display the icon. Starting in API Level 11, you should be able to call is directly using: android.R.drawable.ic_dialog_time
Resources:
http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setIcon(android.graphics.drawable.Drawable)
http://stackoverflow.com/questions/3781363/why-doesnt-this-alertdialog-builder-seticon-show-the-ic-menu-info-icon