How I can remove Action Bar on specific activity not for all application, for example I have Sign Up activity and for this activity I want to remove Action Bar
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
Hide the Status Bar on Android 4. getDecorView(); // Hide the status bar. // status bar is hidden, so hide that too if necessary. ActionBar actionBar = getActionBar();
In your AndroidManifest.xml use NoActionBar theme for your Activity like this:
<activity android:name=".SignUpActivity" android:theme="@style/AppTheme.NoActionBar"/>
and in your styles.xml
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>
from within your activity:
getActionBar().hide();
or
getSupportActionBar().hide();
I would suggest to migrate to ToolBar, new Android API for the same purpose. The main benefit of ToolBar is that you can treat it like other views, it guarantees to you a more flexible approach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With