I want to set an icon at the the end of my Toolbar
,which start another activity.
My Toolbar
portion
If you want something like this (icon 2)
You do not need add icon to the layout manually, you should to implement menu.xml
Create menu.xml like this
Add it in your activity/fragment to the actionbar/toolbar by
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
Handle menu items events
Toolbar with menus works fine, it sets icons to the right of toolbar automatically