No matter what I do I can't set the title in a support toolbar. The only thing on the toolbar is an icon regardless of if I set it.
Followed the guidelines here: http://android-developers.blogspot.de/2014/10/appcompat-v21-material-design-for-pre.html
I have tried every combination of getSupportActionBar.set... and none of them alter the toolbar at all.
Activity:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.gallery);
mToolbar = (Toolbar) findViewById(R.id.galleryToolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setSubtitle("blah blah");
getSupportActionBar().setTitle("blah");
getSupportActionBar().setLogo(R.drawable.icon);
...
}
Layout:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/galleryLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:id="@+id/galleryToolbar"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary">
</android.support.v7.widget.Toolbar>
...
Theme:
<style name="GalleryTheme" parent="@style/Theme.AppCompat.NoActionBar">
<item name="windowActionModeOverlay">true</item>
<item name="android:windowBackground">@android:color/black</item>
<item name="showcaseViewStyle">@style/CustomShowcaseTheme</item>
<item name="actionOverflowButtonStyle">@style/Custom.Widget.ActionButton.Overflow</item>
</style>