1

I would like to Disable Notification Bar using the en, but when i tried to put this code in my OnCreat method in the main Activity, i have some problem. I don't know what to put in <height of the status bar>, what is params i tried to put handleParams, i have the some problem and a problem using context.getWindow().addView(view, params); is unkown and i can't use context.getWindow()

 View disableStatusBar = new View(context);
    WindowManager.LayoutParams handleParams = new WindowManager.LayoutParams(
        WindowManager.LayoutParams.FILL_PARENT,
        <height of the status bar>,
        // This allows the view to be displayed over the status bar
        WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
        // this is to keep button presses going to the background window
        WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
        // this is to enable the notification to recieve touch events
        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |
        // Draws over status bar
        WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
        PixelFormat.TRANSLUCENT);
    params.gravity = Gravity.TOP;
    context.getWindow().addView(view, params);
diez
  • 125
  • 1
  • 5
  • 12
  • Here, give it a look. [Answer][1] http://stackoverflow.com/questions/4222713/hide-notification-bar – dwbrito Apr 23 '13 at 10:38

1 Answers1

1

Just add to your manifest:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
Nickolai Astashonok
  • 2,878
  • 3
  • 20
  • 23