Android Top Tip: Hide the title bar in your application

Default your application will come with a title bar. But you might want to hide it.
In this Android top tip I’ll show you how to do this.

The first approach is done in your activity class in the oncreate method:


The second and third options are done by using styles. You can set the style in your application manifest.
Here’s how to hide the title bar for all activities:

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

And last option is to set the style of the activity in the application manifest:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.