2

I want to make my application go fullscreen in any android device. Hide the Title bar and also the notification bar. The application is supposed to run on a 10 inch tablet on Android 4.0.3. I am using the following code but only the title bar disappears. I want to hide the notification bar also. Can anyone please tell me what I am doing wrong in my code ?

getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Swayam
  • 16,294
  • 14
  • 64
  • 102
  • 1
    Another app that might help is https://play.google.com/store/apps/details?id=de.tsorn.FullScreen which is much like HideBar as suggested by ile – TimothyP Apr 09 '13 at 06:41

2 Answers2

3

try this

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

Hope it helps.

Edit:

The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. Be aware that this works only for the navigation bar used by some handsets (it does not hide the system bar on tablets). The navigation bar returns to view as soon as the system receives user input. As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required

.

abbas.aniefa
  • 2,855
  • 21
  • 30
  • 1
    Yes it is. Please read Controls for system UI visibility section in http://developer.android.com/sdk/android-4.0.html – abbas.aniefa Jun 09 '12 at 13:22
  • My application is for tablets. Is there no way to disable the notification bar for tablets using android 4.0.3 ? – Swayam Jun 09 '12 at 13:35
  • No. You cannot remove the system bar on tablets. – abbas.aniefa Jun 09 '12 at 13:43
  • @abbas.aniefa ye it worked for me also on android tablet. But Now i have to tap two times to get back to my acticty. At first tap it shows my navigation bar and on second tap it do my job. How to avoid this.? – Qadir Hussain Nov 28 '13 at 11:27
1

The thing holding the navigation buttons back and home, time, network information etc is referred to as "navigation" bar.

You can not hide it within the given framework, but it is possible if rooting the device is an option for you:

  1. Root device

  2. Install and run Busybox

  3. Install HideBar

In HideBar there is an option to run in 'Kiosk' mode, in which there is no way to re-display the navigation bar. Needless to say, you really need to be careful with this.

This question was also asked here:

Android tablet navigation bar won't hide

How to remove system bars on Android, I mean, all

Android tablet navigation bar won't hide

Is there a way to hide the system/navigation bar in Android ICS

Hide Tablet system bar

Real Fullscreen with Android 4 Tablets

Easy way to hide system bar on Android ICS

Community
  • 1
  • 1
ılǝ
  • 3,440
  • 2
  • 33
  • 47
  • Wow. I was not aware that it could be done if rooting was allowed on the device. Thank you very much for your answer, especially the links. +1 from my side! – Swayam Nov 17 '12 at 15:32
  • 1
    You are welcome! I spent hours researching this... it is very unfortunate that Google didn't come up with some alternative solution to the challenge of having devices with not button and simply restricted the fullscreen option – ılǝ Nov 17 '12 at 15:43
  • Thank you once again for your help. This is really awesome! – Swayam Nov 17 '12 at 16:29