Can i set toolbar logo in xml? I have tried this so far:
one.
<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 use the toolbar as an action bar in my AppCompatActivity:
setSupportActionBar(findViewById(R.id.toolbar));
I can install the logo from the code:
((Toolbar) findViewById(R.id.toolbar)).setLogo(R.drawable.my_logo);
But I would like to set the logo either from an XML layout or from an XML style / theme.
android android-layout material-design android-toolbar
Denis kniazhev
source share