When you use that style, Android will use a layout that doesn't include an ImageView
for an icon. However, you can call TextView.setCompoundDrawablesWithIntrinsicBounds
using the TextView
that displays the title to show your icon. Otherwise you might look into an implementation like this.
Implementation:
final TextView title = (TextView) findViewById(android.R.id.title);
if (title != null) {
title.setPadding(30, 0, 0, 0);
title.setCompoundDrawablePadding(30);
title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.your_icon, 0, 0, 0);
}
Results