0

i am getting exception when trying to call requestWindowFeature.

I have tried both adding it before and after the onCreate

    requestWindowFeature(Window.FEATURE_NO_TITLE)
    super.onCreate(savedInstanceState)

    getWindow()!!.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN)

    getWindow()!!.requestFeature(Window.FEATURE_ACTION_BAR)

it is running smoothly on api 28 but not working on api level 23

Taha alam
  • 372
  • 3
  • 11

1 Answers1

0

Try this :

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

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);

     getWindow().requestFeature(Window.FEATURE_NO_TITLE);   

    getWindow()!!.requestFeature(Window.FEATURE_ACTION_BAR)  


}
IMParasharG
  • 1,869
  • 1
  • 15
  • 26