I have a code module which implements viewpager with navigation drawer, however, when I run the code I get the following error
01-26 09:20:02.958: D/AndroidR         
        I am a new to Android App development. I faced this error and spend almost 5 hours trying to fix it. Finally, i found out the following was the root cause for this issue and if anyone to face this issue again in the future, please give this a read.
I was trying to create a Home Activitiy with a Video Background, for which i had to change the parent theme from the default setting of Theme.AppCompat.Light.DarkActionBar to Theme.AppCompat.Light.NoActionBar. This worked fine for the Home Activity, but when i set a new button with a onclicklistener to navigate to another Activity, where i had set a custom text to the Action Bar, this error is thrown.
So, what i ended up doing was to create two themes and assigned them to the activities as follows.
Theme.AppCompat.Light.DarkActionBar - for Activities with Action Bar (default)
Theme.AppCompat.Light.NoActionBar - for Activities without Action Bar 
I have made the following changes to make fix the error.
Defining the themes in styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
<style name="DefaultTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
Associating the Activities to their Respective Themes in AndroidManifest.xml
<activity android:name=".Payment"
    android:theme="@style/DefaultTheme"/>
<activity android:name=".WelcomeHome"
    android:theme="@style/AppTheme.NoActionBar">
Please add after Toolbar 
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().hide();
Try this hope it will work, my code is works fine
Toolbar toolbar = findViewById(R.id.toolbar1);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setTitle("");
I got the same error once, I created a template for a default toolbar( toolbar.xml) and then in another view I created a collapsable toolbar.
I required to add the collapsable toolbar to a view that show some information of the user(like whatsapp), but the method findViewById was referencing the default toolbar(id toolbar), not the collapsable one( id toolbar as well) yes, I wrote the same id to both toolbar, so when I tried to access the activity the app crashed showing me the error.
I fixed the error by changing the id of the collapsable toolbar to id:col_toolbar and the error gone away and my app worked perfectly
If you are using android.app.ActionBar and android.app.Activity you should change the app theme in application tag:
< application
     android:theme="@android:style/Theme.Holo.Light">
if u have creat a new toolbar then apply check that u have apply the method setSupportActionBar(); it will defenetly help you