Remove Android Default Action Bar

Remove android default action bar

I've noticed that if you set the theme in the AndroidManifest, it seems to get rid of that short time where you can see the action bar. So, try adding this to your manifest:

<android:theme="@android:style/Theme.NoTitleBar">

Just add it to your application tag to apply it app-wide.

How to disable action bar permanently

By setting activity theme in Manifest,

<activity
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
....
>

How to remove default action bar in Android project?

You can do this in your activity:

 ActionBar actionBar = getSupportActionBar();   \\ or getActionBar()

You can then hide it like this:

 actionBar.hide();

Please note the warning about this in the "Removing the action bar" section of http://developer.android.com/guide/topics/ui/actionbar.html

Android Studio Remove ActionBar

Just go to your styles.xml and change the app theme by replacing whatever actionBar style is provided by NoActionBar.

For example, look at how I have Theme.AppCompat.Light.NoActionBar below.

<!-- Base application theme. -->
<style name="Theme.LearnCookingV2" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryVariant">@color/black</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/colorPrimary</item>
<item name="colorSecondaryVariant">@color/colorPrimaryDark</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>

And remove any line of code in your activity that has something to do with the toolbar. Including the line NavigationUI.setupActionBarWithNavController(this, navController);.
Because it is connecting/setting up the navController with the actionBar which is nothing but the toolbar.

How to remove title bar from the android activity?

Try this:

this.getSupportActionBar().hide();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

try
{
this.getSupportActionBar().hide();
}
catch (NullPointerException e){}

setContentView(R.layout.activity_main);
}

Android Studio - Action Bar remove

in your oncreate() method use this

getActionBar().hide();

If your minSdkVersion is 10 or lower, instead use:

getSupportActionBar().hide();


Related Topics



Leave a reply



Submit