I'd like to place a drawable into a dialogs title bar. I tried the following:
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.some_icon);
dialog.setTitle(R.string.my_dialog_title);
dialog.setContentView(R.layout.my_dialog_layout);
...
The icon doesn't show up but the title moves a little to the right. It seems the dialog reserves space for the drawable but doesn't draw it. I tried several different icons (also from the android resources) but non of them worked.
Call setFeatureDrawableResource()
after show()
.
No idea why this works. :)