Search code examples
androidnotificationsandroid-manifestandroid-notificationsandroid-notification-bar

status/notification bar is appearing despite Theme.NoTitleBar.Fullscreen


In my AndroidManifest.xml I'm using the android:theme="@android:style/Theme.NoTitleBar.Fullscreen" attribute in the application tag. When I start my app from the apps menu, it works: both, the title bar and the status bar are hidden and the app uses the full screen.

However, when I start my app on boot (it is the default home screen), the app still uses the full screen but the status bar is visible.

It looks like that my app is running in the back ground. Starting a new activity in the same app doesn't change that behaviour. I need to restart the app in order to hide the status bar.

Any solutions?

using Android 2.3.6


Solution

  • I found the problem! I had overridden following method:

    @Override
    public void onAttachedToWindow()
    {  
        System.out.println("Onactivity attached :");
        this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
        super.onAttachedToWindow();
    }
    

    Seems like setting the window type to TYPE_KEYGUARD in the first activity causes troubles. I put the code into another activity, now it works, the status bar is never shown :)