I am applying one style to two activities. `MainActivity.java` has toolbar setup instead of action bar, therefore, I have following line in theme style to hide action bar:

```
<item name="windowActionBar">false</item>

```

And in the another activity I have action bar enabled:

```
final ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);

```

But this returns **NOException** error.

I tried following but didn't help either:

```
actionBar.show();

```

**Style:**

```
<style name="BrownTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/brown</item>
    <item name="colorPrimaryDark">@color/dark_brown</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="buttonStyle">@color/brown</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

```

**Elaboration:**
I am using style for two activities. The first activity has it's own toolbar instead of default action bar and the second activity has action bar. If I remove from style then I cannot run the first activity and if I put, then I cannot run the second activity. I want to enable it programatically in second activity.

Is there any possibility to change the style item attributes programatically? or any override method to bypass what I have in style item attributes?