Reputation: 11
How can I add app logo as well as app name?
I tried, but either logo appears or app name, not both.
Upvotes: 1
Views: 512
Reputation: 6663
Just simple way :
Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if(getSupportActionBar()!=null){
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(drawerArrowDrawable);
getSupportActionBar().setIcon(R.drawable.ic_label_black_48dp);
}
You will see a screen like that :
Upvotes: 1
Reputation: 191681
Have you tried setTitle()
and setNavigationIcon()
?
Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("Title");
toolbar.setNavigationIcon(R.drawable.some_icon);
Upvotes: 2