I want to save the home button on the toolbar. I have a minimizing toolbar with an image that disappears when scrolling up. In my other toolbar, I implemented a toolbar using
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
but now it will not work. I can’t see the button when the toolbar is minimized (when the image is not displayed) and when the toolbar is open (when the image is visible and the toolbar expands).
My toolbar code:
Toolbar toolbar = (Toolbar) findViewById(R.id.anim_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle("Awesome");
source
share