Search code examples
androidandroid-theme

Setting NoActionBar theme for a specific layout only


I want to able to remove the action bar for only one layout in my android application. I'm developing in android studio 2.3.1 and I'm using the following code snippet in my styles.xml file. But this is removing the action bar for all the layouts and not for the one i wanted.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

I know i'm doing this wrong, and there should be another way to solve my problem. Hence, I'm open for suggestions and any help regarding this :)


Solution

  • <activity android:name=".YOUR_ACTIVITY"
                android:theme="@style/AppTheme"/>
    

    Add the style to the specific activity to which you wanna remove