Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the work around for TYPE_KEYGUARD now that it's been removed?

Tags:

android

I've successfully disabled the notification bar from appearing by using the following code and now I need to upgrade to version 21 of the SDK.

    @Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
}

However, now I'm getting "cannot find symbol TYPE_KEYGUARD". Does anyone have a workaround for this?

like image 489
Kristy Welsh Avatar asked Dec 22 '25 13:12

Kristy Welsh


1 Answers

Apparently, it's a simple change:

this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
like image 174
Kristy Welsh Avatar answered Dec 24 '25 02:12

Kristy Welsh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!