I want to customize a dialog in Android. I know how to set the title for dialog:
dialog.setTitle(\"O message\");
Now I want to set the icon in
You can add an icon with the following code:
Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.your_icon);
dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle("Dialog Title");
dialog.show();
See "Icons in custom dialogs android".