I decided to create a splashscreen at the beginning of my app. I created a 1600x900 image and used it as a drawable. When I ran my app, it seemed like every action bears a 1 second delay. After checking everything I realized that it was the splashscreen somehow causing this lag. Tests reveal that high resolution images made into drawables this way cause delays, I don't know why.
My image weighs 100kb, I gradually lowered the resolution and the size and the lag gradually lowered as well. I also made a high resolution, 5kb image and the lag persisted, meaning that the resolution is mostly the culprit.
Why is this happening and how can I have a splashscreen without later repercussions?
code:
in styles:
<style name="splashscreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">@drawable/splashscreen</item>
</style>
in manifest:
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:fullBackupContent="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:label="@string/app_name"
android:theme="@style/splashscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>