Why does Android studio insist in this deprecation warning?

82 Views Asked by At

Why do I get a deprecation warning in Android studio Electric Eel | 2022.1.1, despite the fact that I am handling it? This happens no matter what the problem is.

This is my code where I get a deprecation warning for WindowManager.LayoutParams.FLAG_FULLSCREEN:

public void fs(Window dialogWin) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
        final WindowInsetsController insetsController = getWindow().getInsetsController();
        if (insetsController != null) insetsController.hide(WindowInsets.Type.statusBars());
    } else
        dialogWin.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

And if I suppress the warning with a

@SuppressWarnings("deprecation");

I then get a Redundant suppression warning. The only workaround I found was to add

@SuppressWarnings({"deprecation", "RedundantSuppression"})

Silly.

0

There are 0 best solutions below