0

I did a lot of search regarding the topic, but previous stack overflow answers didn't solved my problem. I am developing kiosk mode for an application (Targeted to run on Iball Kitkat tablet- android 4.2.2), and I want to apply kiosk mode to a single activity only. I want to hide/disable/prevent expansion of notification bar of tablet.

What I have tried is :-

and many more

Any help will be appreciated.

Community
  • 1
  • 1
Priya Jagtap
  • 1,023
  • 13
  • 19

1 Answers1

0

Write the following code in your Activity -

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

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

Your app will go full screen without notification bar

  • I added this code to my oncreate() but it throws exception android.util.AndroidRuntimeException: requestFeature() must be called before adding content – Priya Jagtap Nov 30 '16 at 12:08
  • Put `requestWindowFeature(Window.FEATURE_NO_TITLE);` before the `super.OnCreatesavedInstanceState)` – Darshan Pania Nov 30 '16 at 13:01