Android Toolbar Example: How to Use Toolbar as ActionBar
https://www.viralandroid.com/2015/08/android-toolbar-example.html

Related:
Android Action Bar Tutorial and Example With Option Menu
Android Menus: Best Practice and Awesome Android Menu Libraries
Why Toolbar instead of ActionBar?
Toolbar provides us lots of attributes and we can customize it in our own way than ActionBar. Now we can view multiple toolbars within the screen.Welcome Toolbar, Goodbye Action Bar
Just follow the following steps to use Toolbar instead Action Bar.Setup Appcompact Support Library to use Toolbar as ActionBar
You have to add appcompact support library as a dependency in your build.gradle file before jumping to our coding part. Just add compile 'com.android.support:appcompat-v7:22.2.0' in your build.gradle file inside dependencies.dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' }
Change Your App Theme
To use Toolbar as ActionBar you have to use Theme.AppCompact theme, just use Theme.AppCompact.NoActionBar as parent theme.Your modified code of styles.xml file will look like this:
Your AndroidManifest.xml file will look like this:
Adding Toolbar to your Activity Layout
Now you need to add Toolbar to your XML layout. Use the code given below to use Toolbar as Actionbar.Finally, we have to add two lines of code in our java Activity.
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar); setSupportActionBar(toolbar);
Modified code of MainActivity.java file will look like this:
That's all, now run your Toolbar Example application.