I declared a dialog activity in my Manifest as follows:
<activity android:name=".myDialog"
android:label="@string/title_dlg"
android:icon="@android:drawable/ic_dialog_alert"
android:exported="false"
android:excludeFromRecents="true"
android:theme="@android:style/Theme.Dialog">
However, only the title’s text appears in the title bar and the icon appears to be ignored.
Is there a way to also show the icon in the title bar?
Use this after your
super.onCreate(savedInstanceState);call:Then, set your
contentView(R.layout.youLayout);and then use this:
The order is important.