Remove title in Toolbar in appcompat-v7
The correct way to hide/change the Toolbar Title is this:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(null);
This because when you call setSupportActionBar(toolbar);
, then the getSupportActionBar()
will be responsible of handling everything to the Action Bar, not the toolbar object.
See here
getSupportActionBar().setDisplayShowTitleEnabled(false);