so I created an app, but unfortunately, I stumbled upon a small problem. My full-screen code is deprecated and the status bar (but it's only a black line, you can't see batter percentage and clock until you click on that black line) is showing on some devices while on Samsung Note 8 everything is okay. I think the problem is with API but I can't find how to solve this problem. Do you think you can help me?
This is theme.xml, the same code is on the dark and light theme.
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Myapp" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
<!-- Primary brand color. -->
<item name="colorPrimary">@android:color/holo_red_dark</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@android:color/holo_red_dark</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Myapp.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Myapp.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Myapp.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Java class code
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
I tried adding this code but it didn't help
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>