2

Prior to 4.3,

@android:style/Theme.Black.NoTitleBar  

and

 requestWindowFeature(Window.FEATURE_NO_TITLE);
 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
 WindowManager.LayoutParams.FLAG_FULLSCREEN);`

works perfectly to hide the Notification bar. But in 4.3 though the bar is not showing using this code but sliding at the top bring the bar

Sliding shows the screen. See that the bar overlapped 134. enter image description here

Mihir
  • 2,064
  • 2
  • 21
  • 28

2 Answers2

2

I found out there is no simple way to do it. So I use bit of reflection and its working fine.

Object service  = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager");
Method collapse = statusbarManager.getMethod("collapsePanels");
collapse .setAccessible(true);
collapse .invoke(service);

Don't forget to add this in manifest.

<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
Mihir
  • 2,064
  • 2
  • 21
  • 28
0

Have you tried using Theme.Black.NoTitleBar.Fullscreen?

gian1200
  • 3,670
  • 2
  • 30
  • 59
  • See images. The notification bar is hidden but gesture at the top of the screen bring it back. – Mihir Aug 23 '13 at 07:29
  • You said you were using android:style/Theme.Black.NoTitleBar, not android:style/Theme.Black.NoTitleBar.Fullscreen. – gian1200 Aug 23 '13 at 07:55