CopyPastor

Detecting plagiarism made easy.

Score: 1.7459391951560974; Reported for: Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2018-05-13
by Khemraj

Original Post

Original - Posted on 2017-12-01
by sanket vetkoli



            
Present in both answers; Present only in the new answer; Present only in the old answer;

This is **best & easy** way to hide default action bar from android activity.
Put these two styles in `res>values>styles.xml`. You may already have `AppTheme`
<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style>
<style name="AppTheme.NoActionBar" parent="AppTheme"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>
and in your manifest class

<activity android:name=".YourActivityName" android:theme="@style/AppTheme.NoActionBar"> </activity>
If you just want a theme with no action bar you can use 'NoActionBar' variant, for eg. if your base theme is as below
<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style>
then you can use
<style name="AppThemeNoActionBar" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> But if you want to retain the properties of your main theme i.e. AppTheme you can do as below
<style name="AppThemeNoActionBar" parent="AppTheme"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> You can retain all the properties of your base theme this way and don't have to explicitly add them in your NoActionBar theme :)

        
Present in both answers; Present only in the new answer; Present only in the old answer;