how to hide/show overflow icon in custom Toolbar programmatically.
Thanks, Petros
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (!showIcon)
return false;
getMenuInflater().inflate(R.menu.main_activity, menu);
return super.onCreateOptionsMenu(menu);
}
Now, whenever you want to show the overflow icon just make showIcon variable true otherwise false.