The documentation of Toolbar
says
If an app uses a logo image it should strongly consider omitting a title and subtitle.
Just add this attribute to your toolbar
app:title=" "
Nobody mentioned:
@Override
protected void onCreate(Bundle savedInstanceState) {
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
}
Toolbar actionBar = (Toolbar)findViewById(R.id.toolbar);
actionBar.addView(view);
setSupportActionBar(actionBar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
take note of this line getSupportActionBar().setDisplayShowTitleEnabled(false);
The reason for my answer on this is because the most upvoted answer itself failed to solve my problem. I have figured out this problem by doing this.
<activity android:name="NAME OF YOUR ACTIVITY"
android:label="" />
Hope this will help others too.
Toolbar toolbar = findViewById(R.id.myToolbar);
toolbar.setTitle("");
If you are using Toolbar try below code:
toolbar.setTitle("");