Android XML Image Background (Vector Drawable Or Png) Issues With Long Loading

379 views Asked by At

Good Day.Lately i have noticed an horrible delay between activity load which has an image attached to it's background.

Basically here is my simple layout.

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_vip"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="ink.va.activities.VIPActivity">

    <ImageView
        android:id="@+id/rootImageView"
        android:src="@drawable/vip_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY" />
</RelativeLayout>

Meanwhile the issue is that i am very much confused the fact that activity takes a long way to load,if i remove the image,activity goes good,otherwise it takes a while to load,and i have tried to do the same with a PNG file of same image within different dimensions,scaled down with size of image and pixels so it shall be light,meanwhile my device still loads long the activity.The device is Huawei p8 Lite and i reckon it is not issue of device,anyone has any best practice for such situation?Thank you very much.

0

There are 0 answers