How to disable status bar / notification bar on android programmatically?

android, android-manifest

Solution

I think what you're trying to do is programmatically set an activity as fullscreen. If so, consider the following:

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

Source: http://www.androidsnippets.com/how-to-make-an-activity-fullscreen

Problem

i create a lockscreen application.. this application is triggered by SMS.. when a SMS containing command was received, it will display a lock screen activity. my lockscreen activity is using TYPE_KEYGUARD for disabling a home screen button. When device screen turn off and then i turn it on again, my problem is status bar / notification bar still appear on my screen. this is a problem because the user still can access some program through status bar / notification bar even the device is being locked. so i want to dissapear this status bar / notification bar so that the user (theft) can't access that device anymore.. Please help me to solve this..

Original source

Related problems