Is it possible to set Toolbar logo in xml? I have tried this so far:
1.
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
...
android:logo="@drawable/my_logo"
/>
2.
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
...
app:logo="@drawable/my_logo"
/>
EDIT
I'm using toolbar as an actionbar in my AppCompatActivity:
setSupportActionBar(findViewById(R.id.toolbar));
I'm able to set logo from code:
((Toolbar) findViewById(R.id.toolbar)).setLogo(R.drawable.my_logo);
But I'd like to set logo either from layout XML or from Style/Theme XML.
android:logo
, the second --app:logo
– Lunde