How about if you use this code inside theme.xml
or styles.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">@color/white</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
Then inside the Manifest File
instead of applying the theme inside the activity tag like this.
<activity
android:theme="@style/AppTheme"
android:name=".MainActivity"
android:exported="true">
<intent-filter>
...
</activity>
You apply the theme inside the Application Tag instead
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".MainActivity"
android:exported="true">
....
</activity>
</application>