i want to hide the top menu bar in my android device & Tablet.Can any one tell me how to do it?Thanks for any help.
-
Check this out http://stackoverflow.com/a/4388099/833647 – Ken Wolf Jul 23 '13 at 06:07
-
1Include `android:theme="@android:style/Theme.NoTitleBar"` in your `
` tag inside AndroidManifest.file – Paresh Mayani Jul 23 '13 at 06:08 -
In my tablet device, at bottom, there is a navigation bar which consists of back button , home button, signal and battery etc. – joe Jul 23 '13 at 06:11
-
I want to hide that navigation bar. How to do it? – joe Jul 23 '13 at 06:12
-
1Really!!! You want to hide the back and home button!!!!! – shreyas Jul 23 '13 at 06:18
-
yes, i want to hide the back and home button – joe Jul 23 '13 at 06:19
-
I want to hide bottom bar that means the bar with the home, back and recent apps buttons.How hide that bottom bar? – joe Jul 23 '13 at 06:32
-
@joe use the fullscreen theme... – shreyas Jul 23 '13 at 06:40
-
possible duplicate of [Hide System Bar in Tablets](http://stackoverflow.com/questions/12605266/hide-system-bar-in-tablets) – davidcesarino Jul 24 '13 at 01:34
8 Answers
You can achieve this by setting the android:theme attribute to @android:style/Theme.NoTitleBar on your element in your AndroidManifest.xml like this:
<activity android:name=".Activity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

- 1,474
- 9
- 13
-
2I tried this but it gave me this gradle build error: "java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity." – Rock Lee Jun 20 '15 at 03:05
-
`android:theme="@style/Theme.AppCompat.NoActionBar"` Worked for me – luckyging3r Aug 07 '20 at 20:40
In the Activity class you can use this in onCreate method. In api level greater then 11
ActionBar actionBar = getActionBar();
actionBar.hide();
or
getSupportActionBar().hide();

- 20,419
- 10
- 66
- 57
-
1
-
-
No such method getSupportActionBar().it shows error at the line getSupportActionBar().hide(); – joe Jul 23 '13 at 07:43
-
-
For the benefit of searchers, when creating a project in Android Studio, your AndroidManifesst.xml (as shown by @Jay) will reference "AppTheme" as shown below:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
...
If you navigate the folder tree to res/values/styles.xml you can set your style to inherit from a parent style. In my case this did the trick for an application-wide solution.
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
You can remove the '.light' if you are using a dark theme.
Further reading can be found here.

- 16,260
- 18
- 100
- 123
In order to hide the status bar at the bottom of the tab, you can take a look at this library, which I think will help you in your use case. HideBar Library Android. However, this library requires a ROOTed device to work, which I think is the only case you will get it working on devices above versions 4.0.1.
Also, for Android versions < 4, you can try adding the following lines of code in your onCreate()
method before setting the layout.
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().setAttributes(attrs);
or If your application targetSdk
is 11 or above (Honeycomb and beyond), you should be using Holo
style. So, in your Manifest, use in the <application>
tag the attribute:
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen"
For Android version 2.3.3 and below, you can add this to your application
tag from manifest xml: android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
this will make your app run in fullscreen mode.. If you want to have a title bar, just make a custom one and put it into a base activity that all other activities will inherit..
I hope this helps!!!

- 3,786
- 2
- 29
- 52
If you are trying to hide the navigation bar. then here is the link for the answer Permanently hide navigation bar on activity
In your styles.xml add this line of code
<item name="android:windowNoTitle">true</item>
It basically does the same as adding
android:theme="@android:style/Theme.NoTitleBar"
to your Manifest file, but you can keep your own custom styling by adding the line to your styles.xml

- 395
- 3
- 11
Not show from start is better than show and then hide. You can disable showing of top title ActionBar menu by define NoActionBar theme in your application block main AndroidManifest.xml file:
android:theme="@style/AppTheme.NoActionBar"

- 379
- 1
- 5
- 12