2013-04-23 2 views
1

en을 사용하여 알림 표시 줄을 비활성화하고 싶습니다. 그러나이 코드를 주 활동의 OnCreat 메소드에 넣으려고하면 몇 가지 문제가 있습니다. <height of the status bar>에 무엇을 넣을지 모르겠다. params을 넣으려고했는데, 어떤 문제와 문제가 있는데, handleParams을 사용하려고 시도했다. context.getWindow().addView(view, params); 알 수없는 내가알림 표시 줄을 사용 중지하는 방법은 무엇입니까?

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); 
+0

는, 그것을 모양을 제공합니다. [답변] [1] http://stackoverflow.com/questions/4222713/hide-notification-bar – dwbrito

답변

1

context.getWindow() 그냥 매니페스트에 추가 사용할 수 없습니다

다음
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"