I'm using a ViewPager
to slide across 3 screens at the moment, which is initialised in a FragmentActivity
.
My aim is to have a Toolbar
or ActionBar
that remains the same for each page in the ViewPager
- apart from the title, which changes depending on the page you are on.
Does anybody know how I can achieve this?
I have tried the following
mActionBarToolbar = (Toolbar) findViewById(R.id.toolbar);
setActionBar(mActionBarToolbar);
getActionBar().setTitle(mViewPager.getCurrentItem());
But I keep getting an error setActionBar (android.widget.Toolbar) in Activity
cannot be applied to android.widget.support.v7.Toolbar.
Any ideas?