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
How to Access an Existing Sqlite Database in Android
How to Prevent The Activity from Loading Twice on Pressing The Button
Signing My Android Application as System App
Supporting Amazon and Android Market (Google Play) Links Inside Application
Android Build Gradle Is Too Slow (Dependency Resolution)
Crop Square Image to Circle - Programmatically
Combining Two Bitmap Image (Side by Side)
How to Pause Android.Speech.Tts.Texttospeech
What Would Happen If Android App Is Released with Debuggable On
Viewpager Update Fragment on Swipe
Android Listview with Checkbox Problem
How to Get a View from an Event Coordinates in Android
How to Check Which Current Image Resource Is Attached to Imageview in Android Xml
Switch Back/Front Camera on Fly
How to Display a One Time Welcome Screen